Using listeners and signals with Nasal: Difference between revisions

Jump to navigation Jump to search
(Created page with "{{Template:Nasal Navigation}} == Listeners and Signals == The important thing to keep in mind is that custom listeners are generally not about loading or running Nasal files,...")
 
Line 6: Line 6:


So, listeners are callback functions that are attached to property nodes. They are triggered whenever the node is written to, or, depending on the listener type, also when children are added or removed, and when children are written to. Unlike polling loops, listeners don't have the least effect on the frame rate when they aren't triggered, which makes them preferable to monitor properties that aren't written to frequently.  
So, listeners are callback functions that are attached to property nodes. They are triggered whenever the node is written to, or, depending on the listener type, also when children are added or removed, and when children are written to. Unlike polling loops, listeners don't have the least effect on the frame rate when they aren't triggered, which makes them preferable to monitor properties that aren't written to frequently.  
To learn more about managing resources like timers and listeners, please see [[Developing and debugging Nasal code#Managing timers and listeners]].


===setlistener() vs. _setlistener() ===
===setlistener() vs. _setlistener() ===

Navigation menu