pymel.core.windows.radioMenuItemCollection

radioMenuItemCollection(*args, **kwargs)

This command creates a radioMenuItemCollection. Attach radio menu items to radio menu item collection objects to get radio button behaviour. Radio menu item collections will be parented to the current menu if no parent is specified with the -p/parentflag. As children of the menu they will be deleted when the menu is deleted. Collections may also span more than one menu if the -g/globalflag is used. In this case the collection has no parent menu and must be explicitly deleted with the deleteUIcommand when it is no longer wanted.

Flags:
Long name (short name) Argument Types Properties
defineTemplate (dt) unicode ../../../_images/create.gif
 

Puts a 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) bool ../../../_images/create.gif
 
Returns true|false depending upon whether the specified object exists. Other flags are ignored.
gl (gl) bool ../../../_images/create.gif ../../../_images/query.gif
 
Set the collection to have no parent menu. Global collections must be explicitly deleted.
parent (p) unicode ../../../_images/create.gif
 

The parent of the collection. The collection will be deleted along with the parent. Flag can have multiple arguments, passed either as a tuple or a list.

useTemplate (ut) unicode ../../../_images/create.gif
 
Force the command to use a command template other than the current one.

Derived from mel command maya.cmds.radioMenuItemCollection

Example:

import pymel.core as pm

pm.window( menuBar=True )
# Result: ui.Window('window1') #
pm.menu( label='Position' )
# Result: ui.Menu('window1|menu36') #
pm.radioMenuItemCollection()
# Result: ui.RadioMenuItemCollection('window1|menu36|radioMenuItemCollection3') #
pm.menuItem( label='Top', radioButton=False )
# Result: ui.SubMenuItem('window1|menu36|menuItem371') #
pm.menuItem( label='Middle', radioButton=False )
# Result: ui.SubMenuItem('window1|menu36|menuItem372') #
pm.menuItem( label='Bottom', radioButton=True )
# Result: ui.SubMenuItem('window1|menu36|menuItem373') #
pm.menu( label='Number' )
# Result: ui.Menu('window1|menu37') #
pm.radioMenuItemCollection()
# Result: ui.RadioMenuItemCollection('window1|menu37|radioMenuItemCollection4') #
pm.menuItem( label='One', radioButton=True )
# Result: ui.SubMenuItem('window1|menu37|menuItem374') #
pm.menuItem( label='Two', radioButton=False )
# Result: ui.SubMenuItem('window1|menu37|menuItem375') #
pm.menuItem( label='Three', radioButton=False )
# Result: ui.SubMenuItem('window1|menu37|menuItem376') #
pm.showWindow()

Previous topic

pymel.core.windows.radioCollection

Next topic

pymel.core.windows.rangeControl

Core

Core Modules

Other Modules

This Page