tags:

views:

259

answers:

11

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!

+1  A: 

GTK+ it is: runs on most Linux distros and Windows too.

Of course there are also Qt and WxWidgets which are cross-platform.

jldupont
+8  A: 

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.

balpha
+11  A: 

Qt is very good. It has quite large library (not UI only). Runs on a lot of platforms.

n0rd
+10  A: 

Pure X is quite hardcore these days, and not very portable. Basically, there are three major toolkits:

  • GTK+ (and C++ wrapper GTKmm)
  • Qt
  • wxWidgets

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.

el.pescado
Just my two cents from my experience: From easiest and more comfortable to not-so-comfortable-to-work-with - 1. Qt, 2. GTK+, 3.wxWidgets.
Andrejs Cainikovs
I'd have to vote for Qt, too -- it's solid, extensive, easy, portable, and it's pretty widely used in industry, so it could conceivably be more valuable to potential employers than not.
mrkj
A: 

I think you can start with wxWidgets.

Upul
... well, only if you want to use q toolkit inspired by the MFCs. I tried it quite a few years ago, and unless it changed completely, I would never recommend using it
PierreBdR
wxWindgets was created for building inter-platform GUIs. Pete asked for a portable solution, but it is not clear to me if he meant platform as in different Linux platforms, or platform to mean he wants to support both Windows and Linux.
kiamlaluno
+1  A: 

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.

PierreBdR
A: 

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.

mch
A: 

I think there is another issue that you did not mention: where do you want to go with it?

  • do you want to "just learn it" or do you have a specific application in mind?
  • if you have an application, perhaps you also need to consider:
    • what OS you plan to run it on
    • how is the community supporting it: active? is it difficult to get help?
  • what performance do you need/expect?
  • how long do you plan to support it? (you might decide to run^H^H^Hmove away from C++ in a few years, and if so, would it make sense to use a different language - ie Java?)
lorenzog
+3  A: 

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.

BlackAura
+3  A: 

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.

kiamlaluno
A: 

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.

Thomas Matthews