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.
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:
One item may be selected.
Like single, but you can move the mouse with the button down.
Select and unselect as many items as you want with a mouse-click.
Select as many items as you want by sweeping them with the mouse. Control-button-1 sweep to select a non-adjacent set.
def _quit(self):
Called when the quit button is pressed. Derived classes should override this
if they want to intercept "Quit" processing.
Adds a new button to the button panel at the bottom with the given name and
command. Returns the new button.
Fills the list with data, which should be a list of strings. The
listbox's current contents are destroyed.
Returns the lists Toplevel.
Obsolete form of _quit(). Do not use.
_setFixedFont(self)
def _setFixedFont(self):
addButton(self, name, cmd)
def addButton(self, name, cmd):
fillList(self, data)
def fillList(self, data):
getTop(self)
def getTop(self):
quitPressed(self)
def quitPressed(self):