On Tue, 2004-07-06 at 15:32, Frank Warmerdam wrote:
> Is GTK 2 well supported on win32? If not, that will be a major reason to hold
GTK, GUI Toolkits and Cross Platform Portability
Just to throw in my two cents, I've been working on a piece of image
analysis software for the last six months or so that uses GDAL. We
wanted a cross-platform (linux and windows) GUI and after considerable
thought we went with GTKmm/GTK 2. As a C++ programmer, I never liked
GTK's pseudo-object system - it seems like a crude attempt to graft C++
features onto C, and I wanted a proper OO language interface. The GTKmm
interface has an extremely nice and modern design - it uses namespaces,
standard strings and is beautifully crafted. The GTKmm documentation is
also top-notch for the most part as well, though you have to use the GTK
docs for a few basics. A big disadvantage of GTKmm is that being a C++
library, binary compatibility between compilers and platforms is
non-existent. In addition, it's yet another dependency you have to worry
about, and another layer between your app and the OS. So if your major
concern is binary portability and reducing dependencies and you're not
too put off by GTK's syntax, then GTK 2 is fine, I guess...
Support on windows seems OK. GTK 2 now has themes which give you a
better windows look and feel than before, but it's far from perfect. In
particular the file chooser is completely non-standard and feels
prehistoric in comparison with the very nice standard windows file
chooser. After complaints from our customers we now start up a win32
file chooser directly on windows, but it doesn't interact perfectly with
the rest of the system...
Reliability also seems pretty good, on the whole, though you can't help
feeling that GTK is a very heavy extra layer between your app and the
windows calls. It consists of a vast number of libraries and adds
considerable megabytes to any windows installers you make.
An additional problem for GTKmm is that visual studio support for it is
minimal. If you use GTKmm, you're pretty much forced into using mingw,
which doesn't work nearly as well on windows as gcc does on unix. In
particular, debugging is pretty broken.
In summary, we're using GTK(mm) 2 on windows and it's getting the job
done. In retrospect however, I would probably have gone with a
different toolkit, perhaps wxWidgets (formerly wxWindows).
FWIW, the other toolkits we considered were:
- wxWidgets: It changed its name earlier this year from wxWindows - see
the web page for details. Feels substantially lighter than GTK while
providing a nice C++ interface (not quite as nice as GTKmm though).
Tends to give much more native look and feel than GTK on windows. In
particular the file choosers work! You get the feeling that wxWidgets
people are serious about windows support, while for GTK people it's a
sideline. Doesn't have quite all the bells and whistles of GTK.
- Qt: Very well-regarded cross-platform C++ system offering solid
customer support in return for a fee (about $1500 per developer per
platform). There's also a GPL version without the support, but it only
runs on linux. Some people complain that it's a bit bloated and that the
C++ style is pretty dated. We rejected it because (a) we're cheapskates,
and (b) it didn't seem to offer that much over wxWidgets or GTKmm.
- Java: I've used Java quite a lot for cross platform GUIs, but they
never seem to look quite right on either windows or linux. It has it's
own L&F that you either love or hate. Plus I've had numerous problems
with incompatibilities between different JVMs. Ironically enough most of
these incompatibility problems occurred on Solaris machines...
- C#: Microsoft's java clone. The look and feel should be right on
windows at least, and it's undoubtedly a very nice language to code in,
that links well with other visual studio .NET languages. Portability to
linux is still pretty minimal though - I haven't heard much from Mono
for a while and it seems a bit optimistic to imagine that they can keep
up with MS's ever-changing target.
There's a reasonable survey of various toolkit options at:
I disagree with some of the opinions, but it discusses a few other
toolkits I haven't mentioned.