2009

Table Of Contents
The -resizeToFitChildren flag on the window command specifies that
the window automatically resizes to fit all of the elements within the
window. This flag must have a value: a value of 1 turns on the flag, a
value of 0 turns it off.
When you create a window, it is not visible until you use the showWindow
command. The showWindow command without any arguments makes the
last window created visible.
2 Close the window clicking the X in the upper right hand corner.
Referencing controls
When creating windows with MEL scripting, you must ensure that every
window and user interface control is given a unique name. If you do not
explicitly give a window a name, it gets a default name. (In the previous
procedure, the name of the window was window1, even though you didnt
use it.) You cannot reference or modify windows or controls that you dont
know the name of.
To refer to a user interface element by name
1 Create a window with text and a button that closes it by typing the
following in a MEL tab of the Script Editor:
window -resizeToFitChildren 1 testwindow; columnLayout; text
-label "This is a test window you can close by\ clicking the
button below."; button -label "Close" -command "deleteUI
testwindow"; showWindow;
2 Press the Close button in the window.
The window closes.
Creating a window | 625