Creating New Window Palettes

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
craignewman
Posts: 1
Joined: December 16th, 2010, 7:09 pm

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
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

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
Post Reply