This command creates a new menu and adds it to the default window’s menubar if no parent is specified. The menu can be enabled/disabled. Note that this command may also be used on menu objects created using the command menuItem -sm/subMenu true.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
allowOptionBoxes (aob) | bool | ||
|
|||
defineTemplate (dt) | unicode | ||
deleteAllItems (dai) | bool | ||
|
|||
docTag (dtg) | unicode | ||
|
|||
enable (en) | bool | ||
|
|||
exists (ex) | bool | ||
familyImage (fi) | unicode | ||
|
|||
helpMenu (hm) | bool | ||
|
|||
itemArray (ia) | bool | ||
|
|||
label (l) | unicode | ||
|
|||
mnemonic (mn) | unicode | ||
Set the Alt key to post that menu. The character specified must match the case of its corresponding character in the menu item text, but selection from the keyboard is case insensitive. |
|||
numberOfItems (ni) | bool | ||
|
|||
parent (p) | unicode | ||
|
|||
postMenuCommand (pmc) | script | ||
|
|||
postMenuCommandOnce (pmo) | bool | ||
|
|||
tearOff (to) | bool | ||
|
|||
useTemplate (ut) | unicode | ||
visible (vis) | bool | ||
Derived from mel command maya.cmds.menu
Example:
import pymel.core as pm
pm.window( menuBar=True, width=200 )
# Result: ui.Window('window1') #
pm.menu( label='File', tearOff=True )
# Result: ui.Menu('window1|menu43') #
pm.menuItem( label='New' )
# Result: ui.SubMenuItem('window1|menu43|menuItem549') #
pm.menuItem( label='Open' )
# Result: ui.SubMenuItem('window1|menu43|menuItem550') #
pm.menuItem( label='Save' )
# Result: ui.SubMenuItem('window1|menu43|menuItem551') #
pm.menuItem( divider=True )
# Result: ui.SubMenuItem('window1|menu43|menuItem552') #
pm.menuItem( label='Quit' )
# Result: ui.SubMenuItem('window1|menu43|menuItem553') #
pm.menu( label='Help', helpMenu=True )
# Result: ui.Menu('window1|menu44') #
pm.menuItem( 'Application..."', label='"About' )
# Result: ui.SubMenuItem('window1|menu44|Application____') #
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout57') #
pm.button()
# Result: ui.Button('window1|columnLayout57|button49') #
pm.button()
# Result: ui.Button('window1|columnLayout57|button50') #
pm.button()
# Result: ui.Button('window1|columnLayout57|button51') #
pm.showWindow()
pymel.core.windows.menuBarLayout
Enter search terms or a module, class or function name.