How to choose the right GUI toolkit ?

Dan Lenski dlenski at gmail.com
Wed Nov 8 13:38:18 EST 2006


Hi all,
I'm a recent, belated convert from Perl.  I work in a physics lab and
have been using Python to automate a lot of measurement equipment
lately.  It works fabulously for this purpose.  Recently I've wanted to
start writing GUIs for some of my programs, for data visualization and
to make the programs easier to use for some of my co-workers.

So far I've experimented with two Python GUI toolkits: Tkinter and
PyGTK.  I've had some issues with each:

* PyGTK - not very "pythonic", in my opinion.  Have to use get_ and
set_ methods rather than properties.  Have to write ugly things like
textview.insert(textview.get_end_iter(), ...) to append text to a text
buffer.  No useful doc strings, which makes experimenting with new
widgets in IPython a huge pain.  The toolkit feels very "heavyweight".
I don't want to write an XML file and an "action group" just to make a
piddly little menubar with 10 items.

I'm an avid Gnome fan, and love the professionalness and completeness
of GTK, but PyGTK seems frustratingly C-like compared to the
wonderfully designed high-level abstractions I've come to love in
Python!

* TkInter - Seems easy to learn, and better for quick "lightweight"
GUIs.  I wrote a complete working instrument GUI in less than a day of
figuring things out.  Not very Pythonic in terms of creating and
modifying widgets.  No factory functions to quickly create menu items.
My biggest problem with Tkinter is that it is very unreliable under
Cygwin: programs freeze and slow intermittently and the tkMessageDialog
stock dialog boxes show no visible text.

So, is there another toolkit I should be looking at?  Having something
that can run easily on Cygwin and native Windows is a priority so that
I can quickly move programs to new measurement computers.  I like GTK a
lot and Tk is growing on me too.. are there any higher-level "wrapper"
toolkits for GTK and Tk?

Thanks for any advice!

Dan Lenski
University of Maryland




More information about the Python-list mailing list