As you all probably know (or should know :-), some aircraft have config
dialogs (most of them are bound to the Tab-key: bo105, c150, Lightning,
OV-10). Until recently, those had to be purely Nasal-generated dialogs.
Nothing wrong with that, and very powerful, too. But in many cases, a
simple XML dialog would be enough, and much easier to write. Since a few
days it's possible to load XML dialogs for that from Nasal context.
Example:

  var dlg = props.globals.getNode("/sim/gui/dialogs/s64e/config/dialog", 1);
  gui.loadXMLDialog(dlg, "Aircraft/s64e/config-dialog.xml");
  fgcommand("dialog-show", dlg);

That is: decide for a node to load the XML file to (it currently *needs*
to be called "dialog", due to a dialog.cxx limitation, but that's not a
problem). Then load the dialog, and show/close it whenever you feel like
it.

m.


PS: thanks to Andy, this also works with dialogs now that have embedded
    <nasal><open> or <nasal><close> code blocks.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to