I was a bit too quick with this update on listeners. Here's another
change from today:

>  setlistener("/sim/current-view/view-number", func {
>      setprop("/sim/hud/visibility", !cmdarg().getValue());
>  }, 1);

cmdarg() is now declared depreciated and should no longer be used.
I may or may not remove it at some later time. Listener functions
get their parameters now like any other function: via function
argument. So the above example should be:

  setlistener("/sim/current-view/view-number", func(n) {
      setprop("/sim/hud/visibility", !n.getValue());
  }, 1);


Whereby the parameter can be named freely. If the node isn't needed,
then the argument doesn't have to be stated, of course:

  setlistener("/sim/signals/exit", func { print("bye!") });


(There are more parameters available, but I'll explain later
what they are good for. Need some more testing first.)

m.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to