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.
Flags:
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 | ![]() ![]() ![]() |
|
|
|||
ltVersion / lt | unicode | ![]() ![]() ![]() |
|
This flag is used to specify the Maya LT version that this control feature was introduced, if the version flag is not specified, or if the version flag is specified but its argument is different. This value is only used by Maya LT, and otherwise ignored. The argument should be given as a string of the version number (e.g. 2014, 2015). Currently only accepts major version numbers (e.g. 2014.5 should be given as 2014). Flag can have multiple arguments, passed either as a tuple or a list. |
|||
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 | ||
version / ver | unicode | ![]() ![]() ![]() |
|
Specify the version that this menu feature was introduced. The argument should be given as a string of the version number (e.g. 2014, 2015). Currently only accepts major version numbers (e.g. 2014.5 should be given as 2014). |
|||
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.CommandMenuItem('window1|menu43|menuItem465') #
pm.menuItem( label='Open' )
# Result: ui.CommandMenuItem('window1|menu43|menuItem466') #
pm.menuItem( label='Save' )
# Result: ui.CommandMenuItem('window1|menu43|menuItem467') #
pm.menuItem( divider=True )
# Result: ui.CommandMenuItem('window1|menu43|menuItem468') #
pm.menuItem( label='Quit' )
# Result: ui.CommandMenuItem('window1|menu43|menuItem469') #
pm.menu( label='Help', helpMenu=True )
# Result: ui.Menu('window1|menu44') #
pm.menuItem( 'Application..."', label='"About' )
# Result: ui.CommandMenuItem('window1|menu44|Application____') #
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout57') #
pm.button()
# Result: ui.Button('window1|columnLayout57|button50') #
pm.button()
# Result: ui.Button('window1|columnLayout57|button51') #
pm.button()
# Result: ui.Button('window1|columnLayout57|button52') #
pm.showWindow()
pymel.core.windows.menuBarLayout
Enter search terms or a module, class or function name.