The TkTreectrl module wraps the treectrl tk extension for use with python/Tkinter.
I built the module on top of treectrl-2.1, so compatibility with older version of the treectrl widget cannot be guaranteed.
The treectrl widget allows to create fancy things like sortable multi column listboxes and hierarchical tree views. An impressive set of screenshots of things you can do with treectrl can be found at the treectrl web page.
Unpack the zip-archive and type:
python setup.py install.
There's a html reference manual (included in the download). For more detailed information please refer to the treectrl man page (included in the treectrl distribution).
For the most part it seems to work well, but some parts may still be considered experimental (especially I'm not happy with the implementation of the notify_generate() and notify_install() methods; suggestions are welcome).
Please report any bugs to <klappnase (at) freakmail (dot) de>.
Please note:
due to an incompatibility between Python-2.5 and Tktreectrl versions < 2.2.3
the widget will cause a segfault when it is being used with Python-2.5
(this has been observed on several flavors of unix, on
other platforms it may work). This is not a bug in TkinterTreectrl.
For a discussion on this topic look
here.
Upgrading to either Python-2.5.1 or treectrl-2.2.3 fixes the problem, so the patch
for treectrl-2.2.1 I used to offer has been removed.
from TkTreectrl import *This adds the widget classes: Treectrl, MultiListbox, ScrolledTreectrl, ScrolledMultiListbox and ScrolledWidget into the current namespace.
The major change in this release is the introduction of a few new widget classes:
MultiListbox is a Treectrl widget set up to work as a (more or less) full-featured
and very flexible multi column listbox widget.
The ScrolledTreectrl and ScrolledMultiListbox classes use ideas shamelessly
stolen from Pmw.ScrolledListbox to add one or two
static or automatic scrollbars to the widgets. They both inherit from the ScrolledWidget
class that is supposed to make it easy to add scrollbars to any other Listbox or Canvas alike
Tkinter widget.
Changes to the Treectrl widget:
I added the second (optional) last argument to column_delete(), which is new in
treectrl-2.1.1 .
A bug in item_sort() was fixed: it is now possible to use the command and
mode options together, which may be useful if you want to use the same command
in increasing and decreasing mode. To enable this, mode now defaults
to None instead of ascii.
Caution: this change may be backwards incompatible in some cases!
It is also possible now to specify a sequence of strings as mode, like
mode=("integer", "decreasing").
The class variables TreectrlVersion, _last_element and _last_style were
accidentally handled as instance variables, this has been fixed.
TkinterTreectrl-0.8.zip (71 kB)
TkinterTreectrl is free to use and distribute.