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 appear in Create mode of commandFlag 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

import maya.cmds as cmds

pm.window( menuBar=True )
# Result: ui.Window('window1') #
pm.menu( label='Position' )
# Result: ui.Menu('window1|menu65') #
pm.radioMenuItemCollection()
# Result: ui.RadioMenuItemCollection('window1|menu65|radioMenuItemCollection25') #
pm.menuItem( label='Top', radioButton=False )
# Result: ui.CommandMenuItem('window1|menu65|menuItem885') #
pm.menuItem( label='Middle', radioButton=False )
# Result: ui.CommandMenuItem('window1|menu65|menuItem886') #
pm.menuItem( label='Bottom', radioButton=True )
# Result: ui.CommandMenuItem('window1|menu65|menuItem887') #
pm.menu( label='Number' )
# Result: ui.Menu('window1|menu66') #
pm.radioMenuItemCollection()
# Result: ui.RadioMenuItemCollection('window1|menu66|radioMenuItemCollection26') #
pm.menuItem( label='One', radioButton=True )
# Result: ui.CommandMenuItem('window1|menu66|menuItem888') #
pm.menuItem( label='Two', radioButton=False )
# Result: ui.CommandMenuItem('window1|menu66|menuItem889') #
pm.menuItem( label='Three', radioButton=False )
# Result: ui.CommandMenuItem('window1|menu66|menuItem890') #
pm.showWindow()

Previous topic

pymel.core.windows.radioCollection

Next topic

pymel.core.windows.rangeControl

Core

Core Modules

Other Modules

This Page