|
|
Each thread can use local variables, which are distinct from the local variables in other threads. For example, consider the following icon_rules clause:
icon_rules { demo /F { trigger_action: activate { xs=x until == $xs xxxxxx do for_info 'In activate: '^$xs xs=x^$xs done } trigger_action: alt_activate { xs=x until == $xs xxxxxx do for_info 'In alt_activate: '^$xs xs=x^$xs done } } }
If the user double-clicks on the demo icon with mouse button 1 and then again with mouse button 2, two threads will be created to execute the commands in the two trigger_action clauses. In whatever order the user presses OK on each dialog, the two instances of the local variable xs are kept separate, and changes to its value in one thread do not affect its value in the other thread.
See also: