Package peppy :: Package actions
[frames] | no frames]

Package actions

User interface elements (keyboard and GUI)

Actions represent individual commands that can be initiated by the user. The same action is used to represent the keyboard, menu and toolbar command because it doesn't matter how the action is called -- if it's the same action, it's the same class.

If an action should behave differently when called from a different user input method, it should be a different subclass.

An action is represented by a subclass of SelectAction. The menu system calls the method SelectAction.action when the action is invoked by the user. SelectAction represents a simple menu item, toolbar button, or keyboard command. There are subclasses of SelectAction to provide other user interface elements: ToggleAction, RadioAction, ListAction and ToggleListAction.

There are also mixins and subclasses available that include some boilerplate code in order to provide more specific support for types of actions. For instance, there is a RegionMutateAction that handles the details of getting the selection from the STC and provides a single method that the subclass can override to change the text. See peppy.actions.base for more convenience classes and mixins.

Submodules

Classes
  SelectAction
Display a normal menu item, toolbar button, or simple keystroke command.
  ToggleAction
Display a toggle button or toolbar item.
  ListAction
Display a list of items in a menu bar.
  RadioAction
Display a group of radio buttons in a menu bar.
  ToggleListAction
Display a group of toggle buttons in a menu bar.
  OnDemandActionMixin
Mixin to provide on-demand updating as the menubar is opened
  OnDemandGlobalListAction
On-demand list that shares its items in all menu bars.