Reputation: 1747
Let's say the factors for valuing a choice are the library of widgets available, the slope of the learning curve, and the degree of portability (platforms it works on). As far a language binding goes, I'm using C++.
Thanks!
Upvotes: 4
Views: 490
Reputation: 57728
I suggest getting a generic book on GUIs. I have used Borland's, Windows, wxWidgets, QT, and PEG windowing frameworks. In summary, there is no standard, but GUI systems are Event Driven. Study up on Event Driven programming and that should give you an excellent foundation.
Upvotes: 1
Reputation: 12670
Qt is very good. It has quite large library (not UI only). Runs on a lot of platforms.
Upvotes: 11
Reputation: 29699
As you requested a widget library for C++, then I would suggest QT, which was created for that programming language; GTK is good too, but it was created for C (as many of the libraries created for the GNU project which privileges C against C++).
Nobody uses X directly while creating an application; the only people who work directly with X is who is creating a new widget library, as already reported from other people here.
Upvotes: 3
Reputation: 3208
Unless you're planning to write your own UI toolkit, there's really no point in using X directly anymore. Too hard, too much work.
On Linux, you have the two main choices - GTK and Qt. Both work fine. Qt works better as a native C++ toolkit than GTK itself, although GTKmm is a decent C++ wrapper for it. GTK tends to be usable from more languages than Qt, but that doesn't matter if you're using C++ anyway.
Both are cross-platform, but GTK feels somewhat alien on other operating systems, particularly on Mac OS X. Qt feels completely native on Windows, and fairly close on Mac OS X. It also provides a lot of other cross-platform functionality beyond the UI, such as threading, filesystem access, networking, and so on. Qt certainly seems to win on the portability front, at least.
Generally, go with something that's popular - there's more chance of finding good examples, pre-made applications you can dissect, libraries you can use, or even just finding help here.
Upvotes: 3
Reputation: 3609
I think there is another issue that you did not mention: where do you want to go with it?
Upvotes: 0
Reputation: 7393
If you are most familiar with an interested in C, GTK+ is a good place to start. If C++, QT is probably a better choice. Your desktop of choice is also a factor. Gnome uses GTK+, KDE uses QT.
Raw X programming is much to low-level to start with. Very few programs are written directly against the X API directly. There have always been toolkits layered over it. Some of the older toolkits are Motif (Lesstif) and Athena. Don't try to start with those though, they are very old now.
Upvotes: 0
Reputation: 43294
In my opinion, the best C++ GUI toolkit is Qt http://qt.nokia.com
It's cross-plateform (windows, mac os x, linux), efficient and has quite a few nice extensions (Qwt, Qwt3d, QGLViewer, ...)
On the other hand, if you want to learn about GUI programming, I would learn quite a few systems, including GTK, Tk, Motif.
Upvotes: 1
Reputation: 19236
Pure X is quite hardcore these days, and not very portable. Basically, there are three major toolkits:
which are pretty comparable, so which to choose is a matter of taste. All three run on major three operating systems, although GTK+ on Mac and Windows is little bit awkward.
Upvotes: 11
Reputation: 50948
My personal favorite: Qt. It's cross-platform, it's very intuitive, it's extensively documented, there's bindings for many languages (the original is C++), and it's actually fun to develop with it.
Upvotes: 8
Reputation: 96806
GTK+ it is: runs on most Linux distros and Windows too.
Of course there are also Qt and WxWidgets which are cross-platform.
Upvotes: 1