GUI toolkit(s) status
torriem at gmail.com
Sat Nov 22 05:07:45 CET 2014
On 11/20/2014 02:17 AM, Chris Angelico wrote:
> But I agree about the issues with tkinter. So, let's see. Shall we
> wait for Tcl/Tk Unicode support? Recommend people switch to PyGTK? To
> PyQt? To wxPython? To something else? Personally, I'm quite happy with
> GTK2 (though that's with Pike, not Python), and it does have full
> Unicode support; but there are some issues with the interface that
> make it feel a bit clunky. Every other windowing toolkit has its own
> flaws. Even if one of them were to be blessed into the stdlib (which
> would remove the whole "but it's an external dependency" problem),
> there's still no perfect option, and every toolkit will have its
> staunch supporters.
GTK2 and GTK3 are pretty sweet to work with in Python. The bindings are
very nice and fairly idiomatic. So it feels natural. However GTK is not
really cross-platform in any usable way. It's really Unix-only, though
more and more it's moving towards Linux-only. Due to a lack of manpower
and demand, the Windows port lags far behind X11, and despite decent
theming support (I think it can employ mstheme.dll to draw widgets), it
feels foreign and clunky. On Mac things are even worse, as far as I can
see. Just not enough people who can and want to contribute there.
I can't speak for wxWidgets, but when I last looked at it years ago it
fairly reeked of MFC-style GUI programming with event tables instead of
a nice, flexible signal/callback interface. Has this changed?
My current recommendation is to use PyQt or PySide. I'm going to look
at PySide soon, but PyQt feels a bit foreign on Python. Code comes out
looking like C++ using Python keywords. It has its own facilities for
many things as well that overlap Python's standard libraries. But all
in all it is the most cross-platform of any that I've seen. It looks
and can act fairly native on Windows and Mac. Ironically I find Qt
looks best on Linux when using the GTK theme engine.
More information about the Python-list