diff --git a/Nasal/gui.nas b/Nasal/gui.nas index b20e02316..86686aa56 100644 --- a/Nasal/gui.nas +++ b/Nasal/gui.nas @@ -353,8 +353,8 @@ var save_flight = func { var load_flight_sel = nil; var load_flight = func { - var load = func { - fgcommand("load", props.Node.new({ file: cmdarg().getValue() })); + var load = func(n) { + fgcommand("load", props.Node.new({ file: n.getValue() })); fgcommand("presets-commit"); } if (load_flight_sel == nil) @@ -434,6 +434,19 @@ var dialog_update = func(dialog, objects...) { } +## +# Searches a dialog tree for widgets with a particular entry and +# sets their according to "show". +# +var show_widgets = func(node, name, show = 1) { + foreach (var n; node.getChildren()) + show_widgets(n, name, show); + if ((var n = node.getNode("name")) != nil and n.getValue() == name) + node.getNode("hide", 1).setBoolValue(!show); +} + + + ######################################################################## # GUI theming ########################################################################