Howto:Reset/re-init Troubleshooting: Difference between revisions

Jump to navigation Jump to search
m
→‎Nasal dialog: simplify callback creation (untested for now)
m (move img elsewhere, was complicating the table layout)
m (→‎Nasal dialog: simplify callback creation (untested for now))
Line 254: Line 254:
scroll.setLayout(list);
scroll.setLayout(list);


var fgcommandCb = func(command, arguments) {
return func() {
  fgcommand(command, props.Node.new(arguments) );
};
}


##
##
Line 259: Line 264:


var ControlButtons = [
var ControlButtons = [
{name: "Global reset", callback: func() {fgcommand("reset");} },
{name: "Global reset", callback: fgcommandCb("reset") },
# see $FG_SRC/Main/fg_commands.cxx (do_switch_aircraft)
# see $FG_SRC/Main/fg_commands.cxx (do_switch_aircraft)
{name: "Reload aircraft", callback: func() {fgcommand("switch-aircraft",props.Node.new({aircraft:"ufo"}));} },
{name: "Reload aircraft", callback: fgcommandCb("switch-aircraft", {aircraft:'ufo'}) },
# WIP: (placeholders)
# WIP: (placeholders)
{name: "Relocate:KSFO", callback: func() {} },
{name: "Relocate:KSFO", callback: func() {} },

Navigation menu