Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

uiTemplate [-defineTemplate string] [-exists] [-useTemplate string] [string]

uiTemplate is undoable, queryable, and editable.

This command creates a new command template object. Template objects can hold default flag arguments for multiple UI commands. The command arguments are specified with the individual commands using the -defineTemplate flag and the desired flags and arguments. See also setUITemplate.

Return value

stringThe name of the uiTemplate created.

In query mode, return type is based on queried flag.

Flags

defineTemplate, exists, useTemplate
Long name (short name) Argument types Properties
-defineTemplate(-dt) string create
Puts the command in a mode where any other flags and arguments are parsed and added to the command template specified in the argument. They will be used as default arguments in any subsequent invocations of the command when templateName is set as the current template.
-exists(-ex) create
Returns whether the specified object exists or not. Other flags are ignored.
-useTemplate(-ut) string create
Forces the command to use a command template other than the current one.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

//    Create a new template.
//
if (`uiTemplate -exists ExampleTemplate`) {
    deleteUI -uiTemplate ExampleTemplate;
}
uiTemplate ExampleTemplate;

button -defineTemplate ExampleTemplate
    -width 100 -height 40;
frameLayout -defineTemplate ExampleTemplate
    -borderVisible true -labelVisible false;

//    Create a window and apply the template.
//
string $window = `window`;
setUITemplate -pushTemplate ExampleTemplate;
columnLayout -rowSpacing 5;

frameLayout;
columnLayout;
button -label "One";
button -label "Two";
button -label "Three";
setParent ..;
setParent ..;

frameLayout;
columnLayout;
button -label "Red";
button -label "Green";
button -label "Blue";
setParent ..;
setParent ..;

setUITemplate -popTemplate;

showWindow $window;