nuke.Menu

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

# Class Menu

       object --+
                |
    nuke.MenuItem --+
                    |
                   nuke.Menu

Menu

Instance Methods | [hide private]
The menu/toolbar item that was added to hold the command |
addCommand(self, name, **kwargs) Add a new command to this menu/toolbar. |
The submenu that was added |
addMenu(self, **kwargs) Add a new submenu. |
The separator that was created |
addSeparator(self, **kwargs) Add a separator to this menu/toolbar. |
clearMenu(self) Clears a menu. |
Menu or None |
findItem(self, name) Finds a submenu or command with a particular name. |
None |
items(self) Returns a list of sub menu items. |
Menu or None |
menu(self, name) Finds a submenu or command with a particular name. |
String |
name(self) Returns the name of the menu item. |
None |
removeItem(self, name) Removes a submenu or command with a particular name. |
Inherited from `MenuItem`: `invoke`, `script`, `setEnabled` 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]

### addCommand(self, name, **kwargs) |
Add a new command to this menu/toolbar. @param name The name for the menu/toolbar item; this is the only required argument. Parameters: `**kwargs`, `The`, `following`, `keyword`, `arguments`, `are`, `accepted` - command The command to add to the menu/toolbar shortcut The keyboard shortcut for the command. icon An icon for the command. tooltip The tooltip text. index The position to insert the new item in, in the menu/toolbar. readonly Whether the item should be available when the menu is invoked in a read-only context. Returns: The menu/toolbar item that was added to hold the command The menu/toolbar item that was added to hold the command. Note that if command is not specified, then the command will be created as a "nuke.createNode()" using the given name as the node to create.

### addMenu(self, **kwargs) |
Add a new submenu. Parameters: `**kwargs`, `The`, `following`, `keyword`, `arguments`, `are`, `accepted` - name The name for the menu/toolbar item icon An icon for the menu. Loaded from the nuke search path. tooltip The tooltip text. index The position to insert the menu in. Use -1 to add to the end of the menu. Returns: The submenu that was added The submenu that was added.

### addSeparator(self, **kwargs) |
Add a separator to this menu/toolbar. Parameters: `**kwargs`, `The`, `following`, `keyword`, `arguments`, `are`, `accepted` - index The position to insert the new separator in, in the menu/toolbar. Returns: The separator that was created The separator that was created.

### clearMenu(self) |
Clears a menu. Parameters: `**kwargs`, `The`, `following`, `keyword`, `arguments`, `are`, `accepted` - name The name for the menu/toolbar item Returns: true if cleared, false if menu not found

### findItem(self, name) |
Finds a submenu or command with a particular name. Parameters: `name` - The name to search for. Returns: Menu or None The submenu or command we found, or None if we could not find anything.

### menu(self, name) |
Finds a submenu or command with a particular name. Parameters: `name` - The name to search for. Returns: Menu or None The submenu or command we found, or None if we could not find anything.

### name(self) |
Returns the name of the menu item. Returns: String Overrides: MenuItem.name

### removeItem(self, name) |
Removes a submenu or command with a particular name. If the containing menu becomes empty, it will be removed too. Parameters: `name` - The name to remove for. Returns: None true if removed, false if menu not found