Tkinter and WCK (was Re: How come wxPython isn't in the standard library?)

Jon Perez jbperez808 at wahoo.com
Thu Nov 11 01:43:15 EST 2004


BJörn Lindqvist wrote:

> See: http://www.wxpython.org/quotes.php. especially:
> 
> "wxPython is the best and most mature cross-platform GUI toolkit,
> given a number of constraints. The only reason wxPython isn't the
> standard Python GUI toolkit is that Tkinter was there first." - Guido
> van Rossum

I think there's another reason not to standardize on
wxPython and it's that its API is not at all pythonic.
It reminds me too much of a C++ API.

Tkinter's is far easier to use and learn. (PyGtk would be
2nd while PyQt's API, in my experience is just as C++-like and
hard to understand as wxPython's)

Tkinter's two real cons are that:

a) it is [supposed to be] ugly (but see my replies below)
b) it is an additional layer and thus slow

For both a) and b), one big hope for improvement is that
Fredrik Lundh's Tkinter 3000 / Widget Construction Kit (WCK)
has been revived.  You can now do your own Tkinter widgets
in Python.  WCK's API has the traditional pythonic design
(lean, mean, easy to learn) typical of Fredrik Lundh's creations
(like ElementTree and ElementTidy).

WCK widgets might actually provide better performance
as you don't have the additional Tk layer to go through
(or less of it).  I also saw some work to allow Tk widgets
to be written in native Win32 over at effbot.org!

The fact that you can now easily do your own Tkinter widgets
using WCK also means that we might soon see a lot of WCK
widgets which are prettier than the Tk ones.   There are
already some samples over at effbot.org.



> Guess, that answers my question, but isn't "Tkinter was there first" a
> very bad answer? :) It is kinda ugly too, so I wonder why it can't be
> replaced? 

Tkinter is a lot less ugly today than it used to be because
Tk has adopted a more native look (i'm talking about windows
here, dunno about other platforms).  You can actually turn
off that non-standard tear-off menu widget (which I believe
is responsible for as much as 80% of the Tkinter is ugliy
comments) easily too.

Without that tear-off menu disabled, I bet you won't be
able to tell that a modern Tkinter app from a native Win32
one.



More information about the Python-list mailing list