Page 1 of 1

Creating New Window Palettes

Posted: December 17th, 2010, 1:20 pm
by craignewman
Hi - I'm wondering why this does not work:

Code: Select all

var pal = new Window("palette", "Slate", undefined, {resizeable:true});
But this does work:

Code: Select all

thisObj=this;
var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Slate", undefined, {resizeable:true});
Any help with the syntax is appreciated, thanks.
- Craig

Re: Creating New Window Palettes

Posted: December 19th, 2010, 4:36 pm
by lloydalvarez
Are you trying to run it as a dockable panel (ie. installed in the ScriptUI Panels folder and run from the window menu)? Script installed and launched this way have to be run as panels hence the if else statement in the code that is working for you. However you should still get a window that launches from an empty panel. What are you seeing when you say it does not work?

-Lloyd