GUI Toolkits for the X Window System
TeachingMachines writes "Leslie Polzer has written a nice summary of the current state of GUI Toolkits for the X Windows System (article title of the same name). Those of you who are planning to spend hours and hours scouring the Internet for a mature cross-platform GUI toolkit may save some time and trouble by reading this summary. Leslie's review covers the pros and cons of using GTK+, Trolltech QT, FLTK, wxWindows, and the FOX Toolkit."
The one thing I don't like about toolkits (not mentioned in her list of cons) is that if you distribute the source code, whoever is compiling needs to have the toolkit.
I've tried to compile and install programs before and spent a lot of time trying to track down the toolkit libraries.
This is not a good reason to abondon using toolkits, but it is one negative aspect to take into consideration.
Slashdot Syndrome: the sudden, extreme urge to correct someone in order to validate one's self.
It still takes a really long time to find documentation on writing stuff for X in the first place. For instance, I was getting into creating a window manager at one point and found it extremely difficult to find documents about how to acutally program for X. Widget toolkits are not enough in some cases. Some books about low-level X programming are at:
: //www.pconline.com/~erc/advxwnd.htm
http://www.pconline.com/~erc/xwind2nd.htm
http
Unfortunately, I've lost the URLs for the X API docs and containing really good example documentation on X Windows programming in C. If anybody has these URLs, I'd appreciate it, since it took me several days of searching to dig them up and I can't find them anymore (harddrive crashes suck).
www.sitetronics.com/wordpress
It's far more easily cross platform than the competitors. It's a rich GUI toolkit, not limited by least-common-denominator weirdnesses, and backed by a world class rendering layer (java 2D).
Todays Java is not at all what old Java was. It's far faster, and only getting faster with each release, than in the past, far more reliable, far more complete, etc.
This made the article useless. I wonder if he has ever tried QT. It just works! No futzing around. He is biased because you have to pay for the windows port.
This article reads like a Qt flamefest.
I don't see how Qt's "business like homepage" should have anything to do with how good a toolkit Qt is. The "free for linux not for w32" is of course a valid point, but it's the only one.
How small a thought it takes to fill a whole life
one of the biggest problems in writing a RAD graphics software is that lots of users want it to interface with a lot of different toolkits, such as motif, qt, gtk, tk, xt, etc. obviously, it would be nice if they all just chose one, but that will not happen anytime soon. now, we[the company in mind] are thinking of writing our own low level toolkit (since the software currently doesn't have its own widgets). this is basically how new toolkits come into existence and the user base is forced to choose at yet another fork in the road. *sigh*
BSD is for people who love UNIX. Linux is for those who hate Microsoft.
I need to write GUI code that works on all Linux, all HP-UX, all SUN Solaris, all SGI platforms without requiring more than a simple "make".
Our customers would not like it if I told them to find and install version 1.2 of GTK and stuff like that, because in all honestly, on any platform other than Linux most of these toolkit libraries have no simple install mechanism and tend to be buggy.
So Xlib all the way... Simple and it runs on even a 10 year old version of Linux.
I personally think Qt is made irrelevant by both of the others because they are not missing anything Qt offers. The tools that come with Qt may not be bundled with them, but comparable tools do exist and can be used free of charge, and most often as Free Software. Qt's biggest weaknesses are its relic called "MOC" and its business orientation. Yes, it's GPL, but not for MS Windows, so you're not really free. FOX and (especially) wxWindows offer similarly advanced sets of widgets and techniques, so you might as well throw Qt away. In terms of portability, it's the same, and wxWindows even adds OS/2 portability. Believe me, I don't want to be unfair to Trolltech or upset dedicated Qt developers. I tried to be objective, and that's my objective conclusion. Maybe we can discuss this point in the comments for this article.
There is a disturbing trend of recent articles that engage in Qt/KDE bashing. Can't help wondering whether it is really a coincidence or not. For instance, here's another freshmeat editorial from a few months back.
Cross platform, native widgets.
Combined with python it is very simple and easy.
I wouldn't make commercial apps, but for small development, it's my choice.
For me, it came down to documentation. I have a moderately complicated GUI Perl app (Perl because it was the language I was most familiar with). I looked into various toolkits, like wxPerl, GTK/Perl, QT/Perl, but ended up using good ol' reliable Perl/Tk.
The big advantage with picking up Perl/Tk was that the O'Reilly books were extremely informative - good examples on each widget, how they interoperate, how to use them, and larger program examples. The documentation for the other toolkits I considered basically consisted of "look at the arguments this C++ function takes, and use it," which didn't make for an easy time picking things up (wxPerl was the worst in that regard). While an experienced C++ programmer might not have a hard time with that, it was way over my head.
As a result, though, I have a decent app that runs on X11 and Win32. With the great PAR archiver, I can even package the app up in a nice bundle.
Good times.
He missed the best: GNUStep.
GNUStep uses Objective-C and is a clone of the OpenStep API's and is pretty stable.
To write a simple Application you do not have to write that much code any more.
The author claims it is not free software. The FLTK site claims otherwise:
FLTK comes with complete free source code. FLTK is available under the terms of the GNU Library General Public License.
We have ammended the LGPL to explicitly allow static linking of FLTK (or any modified version of FLTK) to your software. The LGPL is not clear on this and we definately want to allow it.
Program in what you like...
Although programming in QT won't get it included into gnome and programming in GTK won't get it included in KDE.
A lot of apps people develop never see the light of day... I've programmed hundreds of little apps for the various companies I've worked for.. I programmed in what I liked.. and what I was used to...
Just because you need to create a little app with a textbox and a button doesn't mean you need to include the HEAVY libraries of gtk/qt/gnome/kde.
Just my thought.
ChiefArcher
1) Tk is very fast to develop with. You can get good gui's out quickly.
2) So now you want to do a complex, involved gui? You can do that too. Don't like stuff that was thrown together quickly by people who don't know anything about GUI design fool you. It's hard work, and it takes a different set of skills. Just because Tk made GUI programming available to just about everyone, don't judge it on the results of everyone trying to do GUI's!
3) Tk has been around for a while, is well tested, well known, and well built. It is the toolkit of choice for Tcl, Python, and lots of other languages.
4) Of course, it is open source, and lots of people use it and know it. If you want to improve it, you can.
http://www.welton.it/davidw/
Yeah, I RTFA and know he disses them with "too hard, too much like Xlib" (actually they're built on Xt, which is built on top of Xlib).
But anybody who thinks Xt is "too hard" probably is out of their depth programming GUIs anyway. (Now, if you think it's ugly, that's a whole 'nother discussion...) And nothing else gives you that level of flexibility and control. (Well, nothing else sane -- if you want to code direct to the X protocol, go right ahead...)
-- Alastair
I can't believe this author missed the one toolkit that's been making so much wave in the last year, namely Java/SWT.
It's the toolkit used to create the Eclipse IDE from IBM, similar in approach to wxWindows...i.e. renders using native widgets on each platfrom (win32 APIs on Windows, GTK+ 2.0 on Linux, Aqua on Mac OS X), but with the same common API on all platforms.
Did I mention coding in Java is much easier than fighting with ancient macros in C or C++?
Plus, SWT apps start up real fast and consume much less resources than the infamous default Java SWING toolkit. Just look at the difference in responsiveness between Eclipse and NetBeans (I call it the Molasses IDE in tribute to its speed).
SWT is the future of Java GUI and because it renders with native widgets it's the way to go for the future.
Did I mention it's open-source and 100% free on all platforms, including windows (unlike Qt).
Plus...you get access to all the standard Java libs (db access, xml processing, web services, threasing, etc...)
The article's biggest strike against Qt is "Very business-oriented main Web site". What the hell is that about? "I'm shocked, shocked! to find marketing going on in this business!". Clue to the author: Qt is made by a company called Trolltech. Companies exist to make money for their employees and shareholders. One of the ways they do that is by (gasp) marketing themselves on the web. That particular company has gone to great lengths to accomodate free software developers; but they still have to make money somehow. If you object to their business model, just say so. But objecting to the fact that their corporate website is "very business oriented" is like objecting to the fact that Slashdot is "very geek oriented".
--
CPAN rules. - Guido van Rossum
"What you get when you download Qt 2/3 is the free X11 version ("Qt Free Edition") which enables you to write non-commercial applications for The X Window System. When you want to create commercial, proprietary, or non-free software, or want to compile your program for Windows or embedded systems, you'll have to pay for the Qt Professional or Enterprise version (both are quite expensive). Qt tried to specify this in their own license (the "QPL") because they felt the GPL could cause them some problems (please see freshmeat article #180 for more information). From Qt 2.2 and upwards, you can now freely choose between the QPL and GPL before building the libraries. That's the whole story; if you feel I missed an important point, feel free to correct me (Qt flames go straight to /dev/null, though). You can read more about Trolltech's licensing issues in freshmeat articles #170, #172, and the one mentioned above."
The author probably doesn't understand the GPL. All of the other tool kits distributed under the GPL can be used in commerical applications and SO CAN THE GPL'ed version of QT. You just have to accept the terms of the GPL to do so, IE: your application must be open sourced! In this sense QT has an avantage! If you buy their commerical license you may then close source your application. What they have done is allow you to pay extra to by-pass the GPL. How is this an evil thing? The other kits do NOT give you a choice, it's the GPL or nothing! Choice is good. QED.
QT != evil.
Have you ever tried to program using the perl bindings? I have done it in the past and was extremely annoyed by the fact that it is a non-stop moving target. It also broke quite often. I ended up abandoning the entire stuff.
Yup, sure have. I've been working with this app for going on three years, producing useful releases every 4-5 months or so, and haven't run across a "moving target" in Perl/Tk. Aside from bugfixes, I haven't had to go back and change any of my code or work around any brokenness in new Perl/Tk releases.
Granted, my app doesn't tax the outer limits of the Tk bindings, but for what I do, I've found Perl/Tk to be a stable and adequate cross-platform toolkit.
I have to agree. Sounds like someone with an axe to pick and yet trying to come across as an "oh look at me I'm knowledgeable and unbiased!" kind of writer. Feh.
t foundation.p hp
So, let's see.
First of all, isn't it funny how the author omits to mention how a clean and thoroughly engineered class hierarchy can help you design more modular software that will be much easier to maintain and refactor? Or do people really think that the KDE project has been improving at the pace it has by mere luck?
> Very business-oriented main Web site
That's a problem how? Do you really MIND that the site provides info for people other than geeks, along with, you know, a completely up to date documentation for each version?
> Main branch depending on one company
This is either pure ignorance or a lie. Typical underhanded FUD. The main branch is GPL'ed, and the KDE Foundation was established to keep the main branch GPL'ed no matter what happens to Trolltech.
http://www.kde.org/whatiskde/kdefreeq
> Commercial developers and people wanting portability have to pay
Commercial developpers *ARE* allowed to sell GPL apps, dammit. THIS is the way of Free Software business.
And Qt 2 is available under for GPL on all the main platforms. That's for portability. Only Qt 3 for Windows requires a commercial license (this wasn't always the case, but according to interviews I read some Windows developpers would routinely use the GPL version in closed source apps, so Trolltech had to discontinue the GPL license on Windows. Thank you, guys. Thank you so much.)
> Huge sources and binaries, library itself takes ages to compile
That's C++ for you, dude. Install a binary package next time.
Additionally, and just because I'm pissed and am most willing to nitpick the bullshit out of existence, 1) Qt ships will ALL the major distribs, and a majority of minor ones -- no need to recompile it, and 2) You don't need to recompile it either for use with older software, as the API is backwards compatible -- which is not the case of all the APIs out there, which he blissfully omitted.
> Objects not referred by namespace but simple literal prefix "Q"
And that's a problem how?
> Dominant Microsoft Windows look
This is either pure ignorance or a lie. I won't even enumerate the number of looks Qt comes with *natively*.
In fact, this is so close to the usual Qt FUD you can hear from certain people that I strongly suspect that the whole purpose of the article was a clumsy attempt at slowing the growing popularity of Qt. Well, sorry, but such retarded FUD won't last three minutes on Slashdot. We may be a bunch of bickering nerds at times, but we know our shit.
If you don't like Qt and are concerned about its growing supremacy, which is your absolute right, then contribute to competing projects to help them improve. Trying to smear shit on competitors will only make your side look desperate. Is this what you want?
Rant other. Let the moderation begin, I have karma to burn.
-- B.
This sig does in fact not have the property it claims not to have.
Qt:
- most polished GUI of the bunch, great documentation, great portability, looks great.
- typesafe callbacks
- smallest learning curve - very easy to use.
- downside: price, MOC preprocessor, very long compiles.
- recommendation: if you have the money - go buy it.
FLTK:
- perhaps the fastest and has the smallest memory footprint of the bunch.
- small size comes with a price - the look and feel is noticably "off" and often you get non-standard widget behavior.
- void* based event callbacks
- fastest compiles
FOX:
- programs look quite professional
- non typesafe events void* pointers that are a royal pain in the butt to use, and are very poorly documented.
- lack of virtual functions for most GUI classes - must use table dispatch for each new class to override behavior.
- only supports UNIX (X11) and Windows
- only has Windows 2000 look on any platform, but looks quite good nonetheless with minimal flicker
- small user base
- no CVS access - maintained by one individual
WxWindows:
- supports the most platforms, has native look.
- large community of support
- many interpreted language bindings
- different behavior on different platforms
- widgets flicker like crazy
- not very stable in my experience
Qt has THE BEST object-oriented design that I have seen, by far. The widget hierarchy, methods, etc... have a very clean and consistent implementation. Also, the documentation is fantastic! It is always current wrt. the library.
- The ease of code integration into Designer by OO derivation is fantastic.
- The speed at which GUI apps can be developed, using TT's Designer is great!
- The qmake program, while not as capable as automake etc..., is still simple and easy to use. Plus, it takes care of his whining about extra steps.
The 'strengths' section on Qt is hopelessly lacking.
I know that Gtk+ is also OO, but to me it seems they bend over backwards to use C++ features from C, creating a bit of a mess. It is not as clean or consistent, either.
As well, while I H8 Motif, the fact that it was overlooked in this review is pretty bad.
A BIG FAN of Qt,
Jamie.
More importantly... What, no GNUstep?
:)
It's amazing how much GNUstep is overlooked given that it is the only toolkit whose featureset can compete with qt. Just like qt, GNUstep is a full framework covering much more than simply building a GUI, and can thus be the foundation of an entire application/environment. The OpenStep frameworks (of which GNUstep is an open-source rewrite) address everything from low-level primitives (collection classes, advanced memory management with garbage collection) to networking, file operations, GUI operations (with a graphical IDE and GUI builder modeled after NeXT, now Apple's Project Builder/Interface Builder) and more.
If more attention were paid to GNUstep, it would get the usage that it deserves. I find it superior to almost every toolkit except for qt (with which it competes neck-to-neck in terms of featureset and consistency), and any Mac OS X or OpenStep/NeXTStep programmer will give a glowing recommendation. Plus, it uses Objective-C