class documentation

A multi-column listbox, where the current selection applies to an entire row. Based on the MultiListbox Tkinter widget recipe from the Python Cookbook (http://code.activestate.com/recipes/52266/)

For the most part, MultiListbox methods delegate to its contained listboxes. For any methods that do not have docstrings, see Tkinter.Listbox for a description of what that method does.

Method __init__ Construct a new multi-column listbox widget.
Method __setitem__ Configure this widget. This is equivalent to self.configure({key,val)}. See configure().
Method activate Undocumented
Method bbox Return the bounding box for the given table cell, relative to this widget's top-left corner. The bounding box is a tuple of integers (left, top, width, height).
Method bind_to_columns Add a binding to each Tkinter.Label and Tkinter.Listbox widget in this mult-column listbox that will call func in response to the event sequence.
Method bind_to_labels Add a binding to each Tkinter.Label widget in this mult-column listbox that will call func in response to the event sequence.
Method bind_to_listboxes Add a binding to each Tkinter.Listbox widget in this mult-column listbox that will call func in response to the event sequence.
Method columnconfigure Configure all table cells in the given column. Valid keyword arguments are: background, bg, foreground, fg, selectbackground, selectforeground.
Method configure Configure this widget. Use label_* to configure all labels; and listbox_* to configure all listboxes. E.g.:
Method curselection Undocumented
Method delete Undocumented
Method get Return the value(s) of the specified row(s). If last is not specified, then return a single row value; otherwise, return a list of row values. Each row value is a tuple of cell values, one for each column in the row.
Method hide_column Hide the given column. The column's state is still maintained: its values will still be returned by get(), and you must supply its values when calling insert(). It is safe to call this on a column that is already hidden.
Method index Undocumented
Method insert Insert the given row or rows into the table, at the given index. Each row value should be a tuple of cell values, one for each column in the row. Index may be an integer or any of the special strings (such as ...
Method itemcget Undocumented
Method itemconfigure Configure the table cell at the given row and column. Valid keyword arguments are: background, bg, foreground, fg, selectbackground, selectforeground.
Method nearest Undocumented
Method rowconfigure Configure all table cells in the given row. Valid keyword arguments are: background, bg, foreground, fg, selectbackground, selectforeground.
Method scan_dragto Undocumented
Method scan_mark Undocumented
Method see Undocumented
Method select Set the selected row. If index is specified, then select row index. Otherwise, if delta is specified, then move the current selection by delta (negative numbers for up, positive numbers for down). This will not move the selection past the top or the bottom of the list.
Method selection_anchor Undocumented
Method selection_clear Undocumented
Method selection_includes Undocumented
Method selection_set Undocumented
Method show_column Display a column that has been hidden using hide_column(). It is safe to call this on a column that is not hidden.
Method size Undocumented
Method yview Undocumented
Method yview_moveto Undocumented
Method yview_scroll Undocumented
Constant FRAME_CONFIG Undocumented
Constant LABEL_CONFIG Undocumented
Constant LISTBOX_CONFIG Undocumented
Property column_labels A tuple containing the Tkinter.Label widgets used to display the label of each column. If this multi-column listbox was created without labels, then this will be an empty tuple. These widgets will all be augmented with a ...
Property column_names A tuple containing the names of the columns used by this multi-column listbox.
Property listboxes A tuple containing the Tkinter.Listbox widgets used to display individual columns. These widgets will all be augmented with a column_index attribute, which can be used to determine which column they correspond to...
Method _pagesize No summary
Method _resize_column Callback used to resize a column of the table. Return True if the column is actually getting resized (if the user clicked on the far left or far right 5 pixels of a label); and False otherwies.
Method _resize_column_buttonrelease_cb Undocumented
Method _resize_column_motion_cb Undocumented
Method _scroll Undocumented
Method _select Undocumented
Instance Variable _column_names Undocumented
Instance Variable _column_weights Undocumented
Instance Variable _labels Undocumented
Instance Variable _listboxes Undocumented
Instance Variable _resize_column_index Undocumented
def __init__(self, master, columns, column_weights=None, cnf={}, **kw): (source)

Construct a new multi-column listbox widget.

Parameters
masterThe widget that should contain the new multi-column listbox.
columnsSpecifies what columns should be included in the new multi-column listbox. If columns is an integer, the it is the number of columns to include. If it is a list, then its length indicates the number of columns to include; and each element of the list will be used as a label for the corresponding column.
column_weightsUndocumented
cnfUndocumented
cnf, kw

Configuration parameters for this widget. Use label_* to configure all labels; and listbox_* to configure all listboxes. E.g.:

>>> mlb = MultiListbox(master, 5, label_foreground='red')
**kwUndocumented
def __setitem__(self, key, val): (source)

Configure this widget. This is equivalent to self.configure({key,val)}. See configure().

def activate(self, *args, **kwargs): (source)

Undocumented

def bbox(self, row, col): (source)

Return the bounding box for the given table cell, relative to this widget's top-left corner. The bounding box is a tuple of integers (left, top, width, height).

def bind_to_columns(self, sequence=None, func=None, add=None): (source)

Add a binding to each Tkinter.Label and Tkinter.Listbox widget in this mult-column listbox that will call func in response to the event sequence.

Returns
A list of the identifiers of replaced binding functions (if any), allowing for their deletion (to prevent a memory leak).
def bind_to_labels(self, sequence=None, func=None, add=None): (source)

Add a binding to each Tkinter.Label widget in this mult-column listbox that will call func in response to the event sequence.

Returns
A list of the identifiers of replaced binding functions (if any), allowing for their deletion (to prevent a memory leak).
def bind_to_listboxes(self, sequence=None, func=None, add=None): (source)

Add a binding to each Tkinter.Listbox widget in this mult-column listbox that will call func in response to the event sequence.

Returns
A list of the identifiers of replaced binding functions (if any), allowing for their deletion (to prevent a memory leak).
def columnconfigure(self, col_index, cnf={}, **kw): (source)

Configure all table cells in the given column. Valid keyword arguments are: background, bg, foreground, fg, selectbackground, selectforeground.

def configure(self, cnf={}, **kw): (source)

Configure this widget. Use label_* to configure all labels; and listbox_* to configure all listboxes. E.g.:

>>> mlb = MultiListbox(master, 5)
>>> mlb.configure(label_foreground='red')
>>> mlb.configure(listbox_foreground='red')
def curselection(self, *args, **kwargs): (source)

Undocumented

def delete(self, *args, **kwargs): (source)

Undocumented

def get(self, first, last=None): (source)

Return the value(s) of the specified row(s). If last is not specified, then return a single row value; otherwise, return a list of row values. Each row value is a tuple of cell values, one for each column in the row.

def hide_column(self, col_index): (source)

Hide the given column. The column's state is still maintained: its values will still be returned by get(), and you must supply its values when calling insert(). It is safe to call this on a column that is already hidden.

See Also
show_column()
def index(self, *args, **kwargs): (source)

Undocumented

def insert(self, index, *rows): (source)

Insert the given row or rows into the table, at the given index. Each row value should be a tuple of cell values, one for each column in the row. Index may be an integer or any of the special strings (such as 'end') accepted by Tkinter.Listbox.

def itemcget(self, *args, **kwargs): (source)

Undocumented

def itemconfigure(self, row_index, col_index, cnf=None, **kw): (source)

Configure the table cell at the given row and column. Valid keyword arguments are: background, bg, foreground, fg, selectbackground, selectforeground.

def nearest(self, *args, **kwargs): (source)

Undocumented

def rowconfigure(self, row_index, cnf={}, **kw): (source)

Configure all table cells in the given row. Valid keyword arguments are: background, bg, foreground, fg, selectbackground, selectforeground.

def scan_dragto(self, *args, **kwargs): (source)

Undocumented

def scan_mark(self, *args, **kwargs): (source)

Undocumented

def see(self, *args, **kwargs): (source)

Undocumented

def select(self, index=None, delta=None, see=True): (source)

Set the selected row. If index is specified, then select row index. Otherwise, if delta is specified, then move the current selection by delta (negative numbers for up, positive numbers for down). This will not move the selection past the top or the bottom of the list.

Parameters
indexUndocumented
deltaUndocumented
seeIf true, then call self.see() with the newly selected index, to ensure that it is visible.
def selection_anchor(self, *args, **kwargs): (source)

Undocumented

def selection_clear(self, *args, **kwargs): (source)

Undocumented

def selection_includes(self, *args, **kwargs): (source)

Undocumented

def selection_set(self, *args, **kwargs): (source)

Undocumented

def show_column(self, col_index): (source)

Display a column that has been hidden using hide_column(). It is safe to call this on a column that is not hidden.

def size(self, *args, **kwargs): (source)

Undocumented

def yview(self, *args, **kwargs): (source)

Undocumented

def yview_moveto(self, *args, **kwargs): (source)

Undocumented

def yview_scroll(self, *args, **kwargs): (source)

Undocumented

FRAME_CONFIG = (source)

Undocumented

Value
dict(background='#888', takefocus=True, highlightthickness=1)
LABEL_CONFIG = (source)

Undocumented

Value
dict(borderwidth=1,
     relief='raised',
     font='helvetica -16 bold',
     background='#444',
     foreground='white')
LISTBOX_CONFIG = (source)

Undocumented

Value
dict(borderwidth=1,
     selectborderwidth=0,
     highlightthickness=0,
     exportselection=False,
     selectbackground='#888',
     activestyle='none',
     takefocus=False)
@property
column_labels = (source)

A tuple containing the Tkinter.Label widgets used to display the label of each column. If this multi-column listbox was created without labels, then this will be an empty tuple. These widgets will all be augmented with a column_index attribute, which can be used to determine which column they correspond to. This can be convenient, e.g., when defining callbacks for bound events.

@property
column_names = (source)

A tuple containing the names of the columns used by this multi-column listbox.

@property
listboxes = (source)

A tuple containing the Tkinter.Listbox widgets used to display individual columns. These widgets will all be augmented with a column_index attribute, which can be used to determine which column they correspond to. This can be convenient, e.g., when defining callbacks for bound events.

def _pagesize(self): (source)
Returns
The number of rows that makes up one page
def _resize_column(self, event): (source)

Callback used to resize a column of the table. Return True if the column is actually getting resized (if the user clicked on the far left or far right 5 pixels of a label); and False otherwies.

def _resize_column_buttonrelease_cb(self, event): (source)

Undocumented

def _resize_column_motion_cb(self, event): (source)

Undocumented

def _scroll(self, delta): (source)

Undocumented

def _select(self, e): (source)

Undocumented

_column_names = (source)

Undocumented

_column_weights = (source)

Undocumented

_labels: list = (source)

Undocumented

_listboxes: list = (source)

Undocumented

_resize_column_index = (source)

Undocumented