Which GUI toolkit is THE best?
rogerb at rogerbinns.com
Sun Mar 12 05:18:50 CET 2006
"invitro81" <invitro81 at gmx.net> wrote in message news:441172c2$1 at news1.ethz.ch...
> But I've no idea which one I should use to start with..
One thing you'll need to carefully decide is where you want
to end up. The different toolkits have different limits on
where you can go. A simple example is printing. Some don't
support it (eg Tkinter didn't 5 years ago when I last used it).
If you will never need to print then that won't matter.
Generally what you'll find is that the toolkits that let
you do more are harder to get started with because you have
to code in such a way as to let the more complicated features
(eg printing) work, and the documentation is bigger because
there is more to document.
These are some of those areas to consider:
Can you print? Does the user get to use their operating
system specific dialog boxes to choose printers etc?
As a developer can you find out if the printer is colour
or black and white? What about the paper size?
Does the toolkit have a way for you to display HTML? How
complicated can the HTML be (eg CSS)? Can you embed widgets
in the HTML?
Do you have to confine gui operations to one thread? How do
you send a message from a worker thread to the gui thread
(the gui thread will block in an event loop - that event loop
needs to be able to be woken up from other threads)
Native look and feel
Will your users expect a native looking application? Will they
want drag and drop? Do they expect rich objects on the keyboard?
Is the toolkit available for all platforms you would want to
run on (Windows, Linux, Mac, BSD etc) and their variations
(different processors, 32 and 64 bit runtimes)?
Can you display other applications as a widget within yours?
What about the other way round? Can you script other applications?
(Python actually has the latter available on many platforms without
the need for the gui toolkit to so)
Does the toolkit support Unicode? How easy is it to use with
What additional packages are there for the toolkit? For example
Pmw provides more widgets to tkinter and their are GL packages
for the various toolkits. If you are going to do graphics heavy
stuff you'll want some way of hooking the toolkit with PIL.
There should be some sort of demo available. wxPython has a fantastic
one showing every single widget with code you edit to see what effect
The documentation should be good as well. Pick a random question such
as "how do I delete all entries in a listbox begining with 'foo'" and
see if you can work it out from the documentation.
There should also be some sort of mailing list and user forums. Look
for helpful answers being given with people being polite.
What I would suggest you do is write a simple application in two or
three different toolkits (eg convert temperature between F and C).
You'll learn various ways of dealing with widget placement and sizers.
(ie what happens if the user makes the containing window larger or
smaller). My suggestions are to try PyGame, Tkinter and wxPython.
You'll be better off having learned lessons from all 3 than just
The piece of good news is that to my knowledge applications written
using any of the toolkits can be packaged up using tools like
py2exe/py2app/cx_Freeze so that you can redistribute them to other
users and those users will not have to know or care that you used
Python and whatever toolkit.
More information about the Python-list