Are there any meta-widget addons to Python/Tk?
Quote:
> I am writing a rather complex UI in Python/Tkinter, and came across
> a need to have more a more advanced listbox widget - with support for
> colors, font tags, etc. There are a number of meta-widgets that do that
> available for Tcl/Tk, but I can't seem to find anything like that for
> Python.
> I am sure that I'm not the only one interested in this
> functionality, so I would like to hear how other people have dealt with
> it and is there anyone who has implemented / currently implementing this
> kind of meta-widgets for Python?
I wrote an "IconListBox" within the framework of Pmw. Basically, this is
a Tkinter.Canvas with items consisting of a small Tix.Pixmap to the left and
a Tkinter.Label to the right.
Most of the functionality isn't affected when you take out the Pixmap code
and add fancier treatment of the text. Note that you can only set one font
and one color for the labels as they are based on Canvas.create_text.
If you need more than that you'll have to derive your listbox from the Text
widget. [...an hour later: hmm, rewriting the IconListBox as a TextListBox
is pretty straightforward. My bottleneck problem now is to find a way to
convert event.y information to the index of the line that is clicked on.
I have work to do now, but I'll see into the matter tonight. 't would be
nice if I had some tips regarding the mentioned problem by then ...hint..]
cjr
(You'll find the IconListBox in my starship cabin in the PmwExt package:
http://starship.skyport.net/crew/cjr. If you don't have Pmw yet, you can
find it at: http://www.dscpl.com.au/pmw/)
--