SetIterator

Constructor

SetIterator <id> (Process set, Process action, <0|1>)

The last parameter is optional and specifies if the iteration must be done only when explicity activated (1) or also when the parent is activated (0). The default value is 1.

Action

When activated, this process iterates over all of the set's children in an unspecified order. On each iteration it sets the action's data to the current item and activates the action.

Predefined children

None

Example


use core
use base

_action_
print_text (Component c)
%{
  TextProperty *t = (TextProperty*) c->get_data ();
  cout << "value: " << t->get_value () << endl;  
%}

_main_
Component root {
  Set s {
    String s1 ("my text 1")
    String s2 ("my text 2")
    String s3 ("my text 3")
  }
  NativeAction print_action (print_text, 1)
  SetIterator (s, print_action, 0)
}

run root