nuke.MenuItem

class nuke.MenuItem

Bases: object

Methods

action

self.action() -> None Get the action associated with this menu item.

icon

self.icon() -> String Returns the name of the icon on this menu item as path of the icon.

invoke

self.invoke() -> None Perform the action associated with this menu item.

name

self.name() -> String Returns the name of the menu item.

script

self.script() -> String Returns the script that gets executed for this menu item.

setEnabled

self.setEnabled(enabled, recursive) -> None Enable or disable the item.

setIcon

self.setIcon(icon) -> None Set the icon on this menu item.

setScript

self.setScript(script) -> None Set the script to be executed for this menu item.

setShortcut

self.setShortcut(keySequence) -> None Set the keyboard shortcut on this menu item.

setVisible

self.setVisible(visible) -> None Show or hide the item.

shortcut

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.