- add fgcommand to reload menubar; that's necessary to make changes visible
at runtime. Example: <key n="99"> <name>c</name> <desc>Update completely useless menu entry.</desc> <binding> <command>nasal</command> <script> time = getprop("/sim/time/elapsed-sec"); setprop("/sim/menubar/default/menu[9]/label", time); </script> </binding> <binding> <command>menu-reload</command> </binding> </key>
This commit is contained in:
parent
11138e3739
commit
7f9b0fbb73
1 changed files with 10 additions and 0 deletions
|
@ -1007,6 +1007,15 @@ do_data_logging_commit (const SGPropertyNode * arg)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
do_menu_reload (const SGPropertyNode *)
|
||||
{
|
||||
globals->get_subsystem("gui")->reinit();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Built-in command: Add a dialog to the GUI system. Does *not*
|
||||
* display the dialog. The property node should have the same format
|
||||
|
@ -1340,6 +1349,7 @@ static struct {
|
|||
{ "property-cycle", do_property_cycle },
|
||||
{ "property-randomize", do_property_randomize },
|
||||
{ "data-logging-commit", do_data_logging_commit },
|
||||
{ "menu-reload", do_menu_reload },
|
||||
{ "dialog-new", do_dialog_new },
|
||||
{ "dialog-show", do_dialog_show },
|
||||
{ "dialog-close", do_dialog_close },
|
||||
|
|
Loading…
Add table
Reference in a new issue