]> git.mxchange.org Git - flightgear.git/commit
add _setlistener() function, so that slow property polling loops can be
authormfranz <mfranz>
Fri, 16 Dec 2005 19:11:03 +0000 (19:11 +0000)
committermfranz <mfranz>
Fri, 16 Dec 2005 19:11:03 +0000 (19:11 +0000)
commit96c0a7bbc16e044524f6aab5d5b74203864640ef
treece842afe2d67d081b7243934fe658421cf2c8c18
parent249a1264ff8ff127abdf424177c81231281b1ff8
add _setlistener() function, so that slow property polling loops can be
replaced with efficient listener callbacks. One use is the new FPS display.
This is reviewed and OK'ed by Andy, relatively trivial and separated from
the rest of Nasal, so problems are quite unlikely and confined to users of
this function.

The callback is executed whenever the property is written to -- even if
the value didn't change. The triggering Node is available via cmdarg().

Examples:  _setlistener("/sim/crashed", func {print("haha!")});
           _setlistener("/foo/bar", func { print(cmdarg().getPath() ~ " changed")})
src/Scripting/NasalSys.cxx
src/Scripting/NasalSys.hxx