ListView

A list view provides a boiler-plate list viewer. It is a ScrollingList object with a set of buttons at the bottom. Derived classes may define their own buttons for the view.

A ListView is arranged on a grid which leaves the 0th row unoccupied, so that derived classes can add a menu (or whatever they want, for that matter) to the top.

Base Classes

Methods

__init__(self, data, width, height, fixedFont, selectMode)

   def __init__(self, data = None, width = 40, height = 20, fixedFont = 0,
                selectMode = BROWSE):

Constructs a ListView. If data is provided, it is a list of strings with which to populate the listbox. fixedFont is used to indicate that the listbox is to be fixed font.

selectMode indicates the Tk mode of selection. Modes of selection are as follows:

SINGLE

One item may be selected.

BROWSE

Like single, but you can move the mouse with the button down.

MULTIPLE

Select and unselect as many items as you want with a mouse-click.

EXTENDED

Select as many items as you want by sweeping them with the mouse. Control-button-1 sweep to select a non-adjacent set.

_quit(self)

   def _quit(self):

Called when the quit button is pressed. Derived classes should override this if they want to intercept "Quit" processing.

_setFixedFont(self)

   def _setFixedFont(self):

addButton(self, name, cmd)

   def addButton(self, name, cmd):

Adds a new button to the button panel at the bottom with the given name and command. Returns the new button.

fillList(self, data)

   def fillList(self, data):

Fills the list with data, which should be a list of strings. The listbox's current contents are destroyed.

getTop(self)

   def getTop(self):

Returns the lists Toplevel.

quitPressed(self)

   def quitPressed(self):

Obsolete form of _quit(). Do not use.