Python GUIs: Abandoning TkInter and welcoming wxPython?

Andrew Cooke andrew at andrewcooke.free-online.co.uk
Tue Jun 29 04:17:52 EDT 1999


In article <slrn7nglvv.g9.behrends at allegro.cse.msu.edu>,
  behrends at cse.msu.edu (Reimer Behrends) wrote:
> Andrew Cooke (andrew at andrewcooke.free-online.co.uk) wrote:
> > Tk isn't the standard GUI for Python - it's the standard GUI.  It's
> > been around for aeons and I, for one, would be a tad annoyed if I
> > had to learn a new GUI each time I learnt a new language.
> >
> > There seem to be two problems with it:
> >
> > 1. Speed.
>
> First of all, I do not even agree that the speed of Tkinter (or other
> Tk-based libraries) is a problem at all. In my experience, the speed
and
> responsiveness has always been more than adequate (as opposed to, say,
> AWT and Swing). Unless you are going to program highly interactive
> graphical games, speed should be more than sufficient.

I agree - but my only use of Tk has been for building GUIs.  I
presumed that the people complaining about speed must have been
trying to do 3d imaging or something, hence my later comments about
going to C to do faster imaging.

[...]
> > For others, I suspect the lack of good docs for Tk is a more serious
> > problem.  There is a pretty steep learning curve involved if you're
> > meeting Tk for the first time (and if you do know it, finding the
> > right way to express it in Python can still mean reading the Tkinter
> > code).
>
> I always thought that Fredrik Lundh's introduction to Tkinter was
> excellent (and easily accessible from the Tkinter page on
> www.python.org, too). What problems do you see with it?

To pick the last example I had problems with - where does anything
tell you how to change the value of a checkbox menu item (not the
same as a checkbox)?  Or if you interactively resize a window and
then pack_forget it, why do you get a chunk of blank canvas?

That's the kind of thing I mean.  OK, it is easy to put something
together to do the basics, but there are a lot of small
(undocumented) wrinkles when it comes to making Tk do exactly what
you want - and I suspect the people complaining about Tk are the
generation after me raised on sophisticated interfaces...  Before
you can get a good application you have to learn a lot (or use a
very basic interface, I guess).

[The answer to the first puzzle is to change the value of the variable
associated with the item - you have to use the special class for
variables.   I have no fix for the second,m except to fix sizes to
make resizing impossible.]

Andrew


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




More information about the Python-list mailing list