Package nuke :: Class MenuItem
[hide private]
[frames] | no frames]

Class MenuItem

object --+
         |
        nuke.MenuItem
Known Subclasses:

MenuItem

Instance Methods [hide private]
String
icon(self)
Returns the name of the icon on this menu item as path of the icon.
None
invoke(self)
Perform the action associated with this menu item.
String
name(self)
Returns the name of the menu item.
String
script(self)
Returns the script that gets executed for this menu item.
None
setEnabled(self, enabled)
Enable or disable the item.
None
setIcon(self, icon)
Set the icon on this menu item.
None
setScript(self, script)
Set the script to be executed for this menu item.
None
setShortcut(self, keySequence)
Set the keyboard shortcut on this menu item.
String
shortcut(self)
Returns the keyboard shortcut on this menu item.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setEnabled(self, enabled)

 

Enable or disable the item.

Parameters:
  • enabled - True to enable the object; False to disable it.
Returns: None

setIcon(self, icon)

 

Set the icon on this menu item.

Parameters:
  • icon - the new icon as a path
Returns: None

setScript(self, script)

 

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')")

Returns: None

setShortcut(self, keySequence)

 

Set the keyboard shortcut on this menu item.

Parameters:
  • keySequence - the new shortcut in PortableText format, e.g. "Ctrl+Shift+P"
Returns: None

shortcut(self)

 

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.

Returns: String