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 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 bool Returns whether the specified object exists or not. Other flags are ignored. gl / gl bool Set the collection to have no parent menu. Global collections must be explicitly deleted. parent / p unicode The parent of the collection. The collection will be deleted along with the parent. useTemplate / ut unicode Force the command to use a command template other than the current one. Flag can have multiple arguments, passed either as a tuple or a list. 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|menu65') # pm.radioMenuItemCollection() # Result: ui.RadioMenuItemCollection('window1|menu65|radioMenuItemCollection25') # pm.menuItem( label='Top', radioButton=False ) # Result: ui.CommandMenuItem('window1|menu65|menuItem940') # pm.menuItem( label='Middle', radioButton=False ) # Result: ui.CommandMenuItem('window1|menu65|menuItem941') # pm.menuItem( label='Bottom', radioButton=True ) # Result: ui.CommandMenuItem('window1|menu65|menuItem942') # 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|menuItem943') # pm.menuItem( label='Two', radioButton=False ) # Result: ui.CommandMenuItem('window1|menu66|menuItem944') # pm.menuItem( label='Three', radioButton=False ) # Result: ui.CommandMenuItem('window1|menu66|menuItem945') # pm.showWindow()