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

Class ToggleListAction

      object --+            
               |            
debug.debugmixin --+        
                   |        
        SelectAction --+    
                       |    
              ListAction --+
                           |
                          ToggleListAction
Known Subclasses:

Display a group of toggle buttons in a menu bar.

This is used to display a list of toggle buttons while only requiring a single action to display the entire list.

The subclass should override the getItems method to return the list of items to display. These items should be strings.

The method isChecked should be overridden by the subclass to provide the checked state for each item.

If the items change their text strings, you should add the OnDemandActionMixin and override the getHash method to indicate when the user interface should redraw the menu.

Nested Classes

Inherited from ListAction: IdCache

Instance Methods
 
__init__(self, frame, menu=None, toolbar=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
isChecked(self, index)
Override this to show whether the index is checked or not.
 
showCheck(self)
 
showEnable(self)

Inherited from ListAction: dynamic, getHash, getIcons, getIndexOfId, getItems, getSubIds, insertIntoMenu

Inherited from SelectAction: __call__, action, getMenuItemName, getTooltip, initPostHook, initPreHook, insertIntoToolbar, isEnabled

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods

Inherited from SelectAction: getHelp, setAcceleratorText, worksWithMajorMode

Inherited from debug.debugmixin: dprint

Class Variables

Inherited from ListAction: abbrev_width, inline, localize_items, menumax

Inherited from SelectAction: alias, default_menu, default_toolbar, global_id, icon, key_bindings, keyboard, name, stock_id, tooltip

Inherited from debug.debugmixin: debuglevel

Properties

Inherited from object: __class__

Method Details

__init__(self, frame, menu=None, toolbar=None)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

isChecked(self, index)

 

Override this to show whether the index is checked or not.

Parameters:
  • index - the position in the list (numbered from zero)
Returns:
True if checked.

showEnable(self)

 
Overrides: SelectAction.showEnable