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

Synopsis

radioCollection [-collectionItemArray] [-defineTemplate string] [-exists] [-global boolean] [-numberOfCollectionItems] [-parent string] [-select string] [-useTemplate string] [string]

radioCollection is undoable, queryable, and editable.

This command creates a radio button collection. Collections are parented to the current default layout if no parent is specified with the -p/parent flag. As children of the layout they will be deleted when the layout is deleted. Collections may also span more than one window if the -gl/global flag is used. In this case the collection has no parent and must be explicitly deleted with the deleteUI command when it is no longer wanted.

Return value

stringFull path name to the collection.

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

Flags

collectionItemArray, defineTemplate, exists, global, numberOfCollectionItems, parent, select, useTemplate
Long name (short name) Argument types Properties
-collectionItemArray(-cia) query
Return a string list giving the long names of all the items in this collection.
-defineTemplate(-dt) string create
Puts the command in a mode where any other flags and args 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.
-global(-gl) boolean createquery
Set the collection to have no parent layout. Global collections must be explicitly deleted.
-numberOfCollectionItems(-nci) query
Return the number of items in this collection.
-parent(-p) string create
The parent of the collection. The collection will be deleted along with the parent.
-select(-sl) string createqueryedit
Select the specified collection item. If queried will return the name of the currently selected collection item.
-useTemplate(-ut) string create
Force 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

window;
columnLayout -adjustableColumn true -rowSpacing 10;
frameLayout -label "Colors";
    columnLayout;
    string $collection1 = `radioCollection`;
    string $rb1, $rb2, $rb3;
    $rb1 = `radioButton -label "Red"`;
    $rb2 = `radioButton -label "Blue"`;
    $rb3 = `radioButton -label "Green"`;
    setParent ..; setParent ..;

frameLayout -label "Position";
    columnLayout;
    string $collection2 = `radioCollection`;
    string $rb4, $rb5, $rb6;
    $rb4 = `radioButton -label "Top"`;
    $rb5 = `radioButton -label "Middle"`;
    $rb6 = `radioButton -label "Bottom"`;
    setParent ..; setParent ..;

radioCollection -edit -select $rb2 $collection1;
radioCollection -edit -select $rb6 $collection2;
showWindow;