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

Class ListAction

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

Display a list of items in a menu bar.

This is used to display a list of items 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. Overriding isEnabled will determine the enable/disable state for all of the items in the list.

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
  IdCache
Instance Methods
 
__init__(self, frame, menu=None, toolbar=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
getSubIds(self)
 
getIndexOfId(self, id)
 
insertIntoMenu(self, menu, pos=None)
 
getHash(self)
 
dynamic(self)
 
getItems(self)
 
getIcons(self)
 
showEnable(self)

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
  menumax = 30
  abbrev_width = 16
  inline = False
  localize_items = False
Should the items in the list be localized? Dynamically generated lists in general won't be, because they represent filenames -- if a filename happened to be named "File" or "Edit" or "Cut" or a common string, they would be transformed to the localized version when they shouldn't be if that's the actual filename.

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)

getSubIds(self)

 
Overrides: SelectAction.getSubIds

insertIntoMenu(self, menu, pos=None)

 
Overrides: SelectAction.insertIntoMenu

showEnable(self)

 
Overrides: SelectAction.showEnable