nuke.MenuItem
- class nuke.MenuItem
Bases:
objectMethods
self.action() -> None Get the action associated with this menu item.
self.icon() -> String Returns the name of the icon on this menu item as path of the icon.
self.invoke() -> None Perform the action associated with this menu item.
self.name() -> String Returns the name of the menu item.
self.script() -> String Returns the script that gets executed for this menu item.
self.setEnabled(enabled, recursive) -> None Enable or disable the item.
self.setIcon(icon) -> None Set the icon on this menu item.
self.setScript(script) -> None Set the script to be executed for this menu item.
self.setShortcut(keySequence) -> None Set the keyboard shortcut on this menu item.
self.setVisible(visible) -> None Show or hide the item.
self.shortcut() -> String Returns the keyboard shortcut on this menu item.
- action() → None
Get the action associated with this menu item.
- icon() → String
Returns the name of the icon on this menu item as path of the icon.
- invoke() → None
Perform the action associated with this menu item.
- name() → String
Returns the name of the menu item.
- script() → String
Returns the script that gets executed for this menu item.
- setEnabled(enabled, recursive) → None
Enable or disable the item. :param enabled: True to enable the object; False to disable it. :param recursive: True to also setEnabled on submenu actions.
- setIcon(icon) → None
Set the icon on this menu item. :param icon: the new icon as a path
- setScript(script) → None
Set the script to be executed for this menu item. Note: To call a python script file, you can use the execfile() function. i.e: menu.setScript(“execfile(‘script.py’)”)
- setShortcut(keySequence) → None
Set the keyboard shortcut on this menu item. :param keySequence: the new shortcut in PortableText format, e.g. “Ctrl+Shift+P”
- setVisible(visible) → None
Show or hide the item. :param visible: True to show the object; False to hide it.
- shortcut() → String
Returns the keyboard shortcut on this menu item. The format of this is the PortableText format. It will return a string such as “Ctrl+Shift+P”. Note that on Mac OS X the Command key is equivalent to Ctrl.