Package peppy :: Module menu :: 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.

Instance Methods
 
__init__(self, frame, menu=None, toolbar=None)
 
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__, __del__, 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, menumax

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

Properties

Inherited from object: __class__

Method Details

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

 
Overrides: ListAction.__init__

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: ListAction.showEnable