Changes

Jump to navigation Jump to search
m
pm2wiki
Line 11: Line 11:  
}));
 
}));
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
<syntaxhighlight lang="nasal">
 +
var name = "test";
 +
var myDialog = {};
 +
 +
myDialog[name] = gui.Widget.new();
 +
myDialog[name].set("name", name);
 +
myDialog[name].set("layout", "vbox");
 +
 +
 +
var graph = myDialog[name].addChild("graph");
 +
graph.set("name", "foo");
 +
 +
 +
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("legend", "Cancel");
 +
cancel.setBinding("dialog-close");
 +
 +
#props.dump( myDialog[name].prop() );
 +
fgcommand("dialog-new", myDialog[name].prop() );
 +
gui.showDialog(name);
 +
 +
</syntaxhighlight>
 +
    
<syntaxhighlight lang="diff">
 
<syntaxhighlight lang="diff">

Navigation menu