Python GUIs: Abandoning TkInter and welcoming wxPython?

Cameron Laird claird at Starbase.NeoSoft.COM
Tue Jun 29 17:41:00 CEST 1999


In article <Pine.GSO.3.96.990625170056.28322B-100000 at saga3.Stanford.EDU>,
Jeffrey Chang  <jefftc at leland.Stanford.EDU> wrote:
			.
			.
			.
>Abandoning Tkinter seems a little bit extreme, since there are some
>applications for which its event model is well-suited. 
>
>A few weeks ago I needed to build a viewer that displays binary trees
>whose branches have variable lengths (actually, phylogenetic trees for
>biological data).  Since the trees are large, I need to be able to slide
>it around the window.  In addition, I needed each node to be clickable so
>that the user can query for more data. 
>
>Tkinter is very good for that type of thing.  All I needed to do was
>create a Canvas and then for each node, create an Oval with a callback to
>a function that handles node clicks.  Tk keeps track of the coordinates of
>each Item so that I don't have to.  Also, whenever I wanted to move the
>tree, all I had to do was:
>for widget in self._canvas.find_all():
>    self._canvas.move(widget, xoff, yoff)
>
>Of course, Tk incurrs an overhead by making everything you draw on the
>canvas its own object, but for this case, it made thigns a lot easier.
			.
			.
			.
I don't get the point of the last paragraph.  I think you're
saying that good style in canvas programming is in terms of
objects; if you're doing a lot of pixel-pushing, then you're
in trouble, because Tk wraps even pixels up as objects, with
a predictable performance hit.  Is that correct?
-- 

Cameron Laird           http://starbase.neosoft.com/~claird/home.html
claird at NeoSoft.com      +1 281 996 8546 FAX




More information about the Python-list mailing list