pyface.action.action_controller module

The default action controller for menus, menu bars and tool bars.

class pyface.action.action_controller.ActionController[source]

Bases: HasTraits

The default action controller for menus, menu bars and tool bars.

perform(action, event)[source]

Control an action invocation.

Parameters
  • action (Action) – The action to perform.

  • event (ActionEvent) – The event that triggered the action.

Returns

result – The result of the action’s perform method (usually None).

Return type

Any

can_add_to_menu(action)[source]

Can add an action to a menu

Parameters

action (Action) – The action to consider.

Returns

can_addTrue if the action can be added to a menu/menubar.

Return type

bool

add_to_menu(action)[source]

Called when an action is added to the a menu/menubar.

Parameters

action (Action) – The action added to the menu.

can_add_to_toolbar(action)[source]

Returns True if the action can be added to a toolbar.

Parameters

action (Action) – The action to consider.

Returns

can_addTrue if the action can be added to a toolbar.

Return type

bool

add_to_toolbar(action)[source]

Called when an action is added to the a toolbar.

Parameters

action (Action) – The action added to the toolbar.