tutorial vbox true 3 hbox 1 true true var list = cmdarg().getNode("group[2]/group/list"); var node = props.globals.getNode("/sim/tutorials", 1); var tut = node.getChildren("tutorial"); var current = node.getNode("current-tutorial", 1); # fill listbox list.removeChildren("value"); forindex (var i; tut) { var name = tut[i].getNode("name"); if (name == nil) { die("tutorial #" ~ i ~ " has no <name>"); } name = name.getValue(); list.getChild("value", i, 1).setValue(name); } var select = func { var name = current.getValue(); foreach (var t; tut) { if (t.getNode("name").getValue() == name) { setprop("/sim/tutorials/current-description", string.trim(t.getNode("description").getValue())); break; } } fgcommand("dialog-update", props.Node.new({"object-name": "textbox", "dialog-name": "tutorial"})); } if (current.getType() == "NONE" or current.getValue() == "") { current.setValue(tut[0].getNode("name").getValue()); select(); } hbox 0 7 left /sim/tutorials/current-tutorial 1 true hbox fill true textbox fill fill true 600 480 20 true false 1 /sim/tutorials/current-description vbox list fill fill true 170 400 /sim/tutorials/current-tutorial dialog-apply list nasal