As we have seen, there are quite a few ways to build a GUI in Python and in some cases a choice is difficult. How, for instance, can you choose among Tk, wxWindows, FLTK or FOX if you do not have knowledge or experience in them? Well, before you make a choice you should have a look at each of them in any case. And you should check the following issues:
- The number of widgets. Well, if they are ugly or unnecessarily numerous, you will not be satisfied. But a diversity of good looking and functional widgets will help you design a good interface, especially if you are not a GUI designer.
- Look. It is very important nowadays to allow an application to look exactly according to the current theme of the operationg system, including widgets that do not exist on a particular OS.
- For some projects it may also be important to change the look-&-feel of the application when changing the theme of the OS.
- It is also 'in' to be able to create your own look-&-feel
- It is important to be able to create your own components.
If you need, see whether you can create your own windows or use transparent screen areas. - See if widgets provide transparency and layering.
- See if it is possible to locate widgets both absolutely and relatively.
- See if zooming is supported. I do not know of any GUI library for Python that does
- See if the image formats you work with are supported. I recommend to check out PNG because it is compressed, transparent, interlacing, animateable and supported by the Internet Explorer.
- Look at the geometry capabilities. It may sound weird but the most important geometric figure is a dot. Some packages provide you with lines, circles and what not but when you wish to draw whatever you wish, you often need just a dot :). It may be specially true if you wish to go into charting.
- Text and language issues:
- Internationalization:
- Unicode
- Locales. Locale is a convenient tool bacause besides the language you can specify the time, monetary and other options.
- Some GUI libraries offer you good text components in which you can show formatted text.
Some even go further and allow you show text directly in the common formats (HTML, rtf, pdf, doc)
- Grid.
- Ability to use any other widget as a cell.
- Speed. Grids can work slowly with large data chunks.
- Cross platform compatibility may be important to you. There are three issues:
- Does it cover all the platforms you need
- Does it really look fine on all platforms:
- when you do not define a specific look-&-feel and your application uses the OS l&f
- when you use a certain l&f
- You write one code and do not go into the OS specifics
- Separation between data and presentation. It is particularly convenient when your GUI is based on some changing data.
- Check the license
- How popular the library is. The more popular it is the more chances there are that it will not vanish tomorrow morning. For example, Tk IS popular. wxWindows is also popular because many people out there consider it to be better than Tk. But who can compare with GTK+ which is a part of such projects as GNOME and GIMP?!
- Who stands behind the library. It is very important to know that the development of the library you use will continue for as long as you need.
- Open source or proprietary? It is good when a rich company stands behind a libary. But they can grab you by the ... .
Open source is theoretically unreliable from many aspects but in practice it is the best because the best brains stand behind it. - There are also other, I call them traditional, considerations such as speed, memory use, multithreading and many others but the packages listed above are good. In any case, if you know of some theoretical problem that may come up, test it. For example if you are writing an image browser, load a hundred PSD thumbs into a slider and see if it stands the pressure.
Comparison chart of all the packages listed here - UNDER CONSTRUCTION
It is going to be a table with the following paramaters for comparison:
- Shell: whether it is performed as you type (like Python, Tk, DOS etc)
- Widgets: number and usefulness
- Native fook-&-leel issues
- Realtime theme change
- Custom l&f
- Transparent top level windows
- Absolute layout
- Relative layout
- Supported image formats
- Localization
- Unicode and internationalization
- Data structures and graphical widget for supporting formatted text
- Text Formats: HTML, RTF, XML etc
- Grid support
- Platforms
- View-Model Architecture
- License type
- Used in Longliving Projects (QT in KDE, GTK in GIMP etc)
- Who is the developer