Using listeners and signals with Nasal: Difference between revisions

Jump to navigation Jump to search
→‎setlistener(): testing indicated that this is the way it works.
(→‎setlistener(): testing indicated that this is the way it works.)
Line 78: Line 78:
'''<function>''' The second argument is a function object (not a function call!). The function you pass here will be called with the target property node as its sole argument as soon as someone writes to the property.
'''<function>''' The second argument is a function object (not a function call!). The function you pass here will be called with the target property node as its sole argument as soon as someone writes to the property.


'''<startup=0>''' The third argument is optional. If it is non-null, then it causes the listener to be called initially. This is useful to let the callback function pick up the node value at startup.
'''<startup=0>''' The third argument is optional. If it is non-zero, then it causes the listener to be called initially (but not if runtime is 1). This is useful to let the callback function pick up the node value at startup.


'''<runtime=1>''' The fourth argument is optional, and defaults to 1. This means that the callback function will be executed whenever the property is written to, independent of the value.  
'''<runtime=1>''' The fourth argument is optional, and defaults to 1. This means that the callback function will be executed whenever the property is written to, independent of the value.  
574

edits

Navigation menu