Changes

Jump to navigation Jump to search
no edit summary
Line 17: Line 17:  
var myDialog = {};
 
var myDialog = {};
   −
myDialog[name] = gui.Widget.new();
+
myDialog = gui.Widget.new();
myDialog[name].set("name", name);
+
myDialog.set("name", name);
myDialog[name].set("layout", "vbox");
+
myDialog.set("layout", "vbox");
      −
var graph = myDialog[name].addChild("graph");
+
var image = myDialog.addChild("image");
graph.set("name", "foo");
+
image.set("name", "someImage");
   −
 
+
var cancel = myDialog.addChild("button");
var code = "io.load_nasal(getprop('sim/fg-root') ~ '/Nasal/foo.bar');";
  −
graph.addChild("nasal").set("load", code);
  −
 
  −
var cancel = myDialog[name].addChild("button");
   
cancel.set("key", "Esc");
 
cancel.set("key", "Esc");
 
cancel.set("legend", "Cancel");
 
cancel.set("legend", "Cancel");
 
cancel.setBinding("dialog-close");
 
cancel.setBinding("dialog-close");
   −
#props.dump( myDialog[name].prop() );
+
fgcommand("dialog-new", myDialog.prop() );
fgcommand("dialog-new", myDialog[name].prop() );
   
gui.showDialog(name);
 
gui.showDialog(name);
  

Navigation menu