pyface.action.action_item module¶
An action manager item that represents an actual action.
- class pyface.action.action_item.ActionItem[source]¶
Bases:
ActionManagerItem
An action manager item that represents an actual action.
- id = Property(Str)¶
The item’s unique identifier (‘unique’ in this case means unique within its group).
- action = Instance(Action)¶
The action!
- control = Any()¶
The toolkit specific control created for this item.
Add the item to a menu.
- Parameters
parent (toolkit control) – The parent of the new menu item control.
menu (toolkit menu) – The menu to add the action item to.
controller (pyface.action.action_controller.ActionController or None) – The controller to use.
- add_to_toolbar(parent, tool_bar, image_cache, controller, show_labels=True)[source]¶
Adds the item to a tool bar.
- Parameters
parent (toolkit control) – The parent of the new menu item control.
tool_bar (toolkit toolbar) – The toolbar to add the action item to.
image_cache (ImageCache) – The image cache for resized images.
controller (pyface.action.action_controller.ActionController or None) – The controller to use.
show_labels (bool) – Should the toolbar item show a label.
- add_to_palette(tool_palette, image_cache, show_labels=True)[source]¶
Adds the item to a tool palette.
- Parameters
parent (toolkit control) – The parent of the new menu item control.
tool_palette (toolkit tool palette) – The tool palette to add the action item to.
image_cache (ImageCache) – The image cache for resized images.
show_labels (bool) – Should the toolbar item show a label.