Table of Contents

Class: MultiListbox TkTreectrl/MultiListbox.py
A flexible multi column listbox widget for Tkinter.
    Based on the Treectrl widget, it offers the following additional configuration options:
    
        columns -           a sequence of strings that defines the number of columns of the widget.
                            The strings will be used in the columnheader lines (default: (' ',)).
        command -           an optional command that will be executed when the user double-clicks
                            into the listbox or presses the Return key. The listbox index of the item
                            that was clicked on resp. of the currently active item is passed as argument
                            to the callback; if there is no item at the event coordinates resp.
                            no active item exists, this index will be -1 (default: None).
        expandcolumns -     a sequence of integers defining the columns that should expand
                            horizontally beyond the requested size when the widget is resized
                            (note that the rightmost column will always expand) (default: ()).
        selectcmd -         an optional callback that will be executed when the selection of the 
                            listbox changes. A tuple containing the indices of the currently
                            selected items as returned by curselection() will be passed to the
                            callback (default: None).
        selectbackground -  the background color to use for the selection rectangle (default: #00008B).
        selectforeground -  the foreground color to use for selected text (default: white).
    
    By default, the widget uses one pre-defined style for all columns; the widget's style()
    method allows to access and configure the default style, as well as applying new
    user-defined styles per column.
    The default style defines two elements, "text" and "select" (which describes attributes
    of the selection rectangle); these may be accessed and configured with the element() method.
    Conversion between listbox indices and treectrl item descriptors can be done with the item()
    and index() widget methods.
    Besides this, most common operations can be done with methods identical or very similar to
    those of a Tkinter.Listbox, with the exception of the selection_xxx() methods, where
    the treectrl methods are kept intact; for Tkinter.Listbox alike methods, use select_xxx().
Base Classes   
Treectrl
Methods   
__init__
activate
bbox
cget
column
configure
curselection
delete
element
get
index
insert
item
keys
nearest
numcolumns
see
select_anchor
select_clear
select_includes
select_set
size
sort
style
  __init__ 
__init__ (
        self,
        master=None,
        columns=( ' ', ),
        selectcmd=None,
        command=None,
        expandcolumns=(),
        showroot=0,
        selectforeground='white',
        selectbackground='#00008B',
        **kw,
        )


  activate 
activate ( self,  index )

Like Tkinter.Listbox.activate(). Note that this overrides the activate()
        method inherited from Treectrl.
  bbox 
bbox (
        self,
        index,
        column=None,
        element=None,
        )

Like item_bbox(), except that it requires a listbox index instead
        of a treectrl item descriptor as argument.
  cget 
cget ( self,  key )


  column 
column ( self,  index )

Return the column identifier for the column at INDEX.
  configure 
configure (
        self,
        cnf=None,
        **kw,
        )


  curselection 
curselection ( self )

Like Tkinter.Listbox.curselection().
  delete 
delete (
        self,
        first,
        last=None,
        )

Like Tkinter.Listbox.delete() except that an additional index descriptor
        ALL may be used, so that delete(ALL) is equivalent with delete(0, END).
  element 
element ( self,  element )

Return the treectrl element corresponding to ELEMENT.
        ELEMENT may be "text" or "select".
  get 
get (
        self,
        first,
        last=None,
        )

Like Tkinter.Listbox.get(), except that each element of the returned tuple
        is a tuple instead of a string; each of these tuples contains the text strings
        per column of a listbox item.
  index 
index (
        self,
        which=None,
        item=None,
        )

Like Tkinter.Listbox.index(), except that if ITEM is specified, the
        listbox index for the treectrl item descriptor ITEM is returned.
  insert 
insert (
        self,
        index,
        *args,
        )

Similar to Tkinter.Listbox.insert(), except that instead of one string
        a number of strings equal to the number of columns must be given as arguments.
        It is an error to specify more or fewer arguments than the number of columns.
  item 
item ( self,  index )

Return the treectrl item descriptor for the item at INDEX.
  keys 
keys ( self )


  nearest 
nearest ( self,  y )

Like Tkinter.Listbox.nearest().
  numcolumns 
numcolumns ( self )

Return the number of listbox columns.
  see 
see ( self,  index )

Like Tkinter.Listbox.see(). Note that this overrides the
        see() method inherited from Treectrl.
  select_anchor 
select_anchor ( self,  index=None )

Like Tkinter.Listbox.select_anchor(), except that it if no INDEX is specified
        the current selection anchor will be returned.
  select_clear 
select_clear (
        self,
        first=None,
        last=None,
        )

Like Tkinter.Listbox.select_clear(), except that if no arguments are
        specified, all items will be deleted, so that select_clear() is equivalent
        with select-clear(0, END).
  select_includes 
select_includes ( self,  index )

Like Tkinter.Listbox.select_includes().
  select_set 
select_set (
        self,
        first,
        last=None,
        )

Like Tkinter.Listbox.select_set().
  size 
size ( self )

Like Tkinter.Listbox.size().
  sort 
sort (
        self,
        column=None,
        element=None,
        first=None,
        last=None,
        mode=None,
        command=None,
        notreally=0,
        )

Like item_sort(), except that the item descriptor defaults to ROOT
        (which is most likely wanted) and that the FIRST and LAST options require
        listbox indices instead of treectrl item descriptors.
  style 
style (
        self,
        index,
        newstyle=None,
        )

If NEWSTYLE is specified, set the style for the column at INDEX to NEWSTYLE.
        Return the style identifier for the column at INDEX.

Table of Contents

This document was automatically generated on Mon Dec 4 00:48:15 2006 by HappyDoc version 2.1