Code: Select all
function myScript(thisObj) {
var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", "script", undefined);
if (pal != null) {
var res=
"Group { \
orientation: 'column', \
alignment: ['fill', 'fill'], \
alignChildren: ['left', 'top'], \
minimumSize: [125, 26],\
one: Group { \
orientation: 'row', \
new_window: Button {text: 'create new window', size: ['120', '25']}, \
} \
}";
pal.grp = pal.add(res);
pal.layout.layout(true);
pal.layout.resize()
pal.grp.one.new_window.onClick = function () {
newWindow ();
}
return pal;
} // if (pal != null) {
} // function myScript_buildUI(thisObj) {
function newWindow() {
var win = new Window("palette");
if (win != null) {
var res=
"Group { \
orientation: 'column', \
alignment: ['fill', 'fill'], \
alignChildren: ['left', 'top'], \
minimumSize: [125, 26],\
one: Group { \
orientation: 'row', \
new_button: Button {text: 'new button', size: ['100', '25']}, \
} \
}";
win.grp = win.add(res);
win.layout.layout(true);
win.layout.resize()
win.show()
alert("A window is behind me and will close as I close this.")
} // if (pal != null) {
} // function myScript_buildUI(thisObj) {
ui = myScript()
ui.show()