views:

1138

answers:

8

What is the easiest cross platform widget toolkit? that minimally covers Windows, osx, and Linux with a c or c++ interface?

+4  A: 

Are we talking GUI Widgets? If so, I can suggest 3

FLTK:

http://www.fltk.org/

GTK:

http://www.gtk.org/

QT:

http://trolltech.com/products/qt/

Cetra
I don't think GTK works on Mac OS X except via the X11 subsystem (which makes it look very much not like a native app).
pdc
I worked on a large cross-platform application that used FLTK and we wished we hadn't. Save it for smaller stuff.
Justsalt
@Justsalt: Interesting. Could you explain what problems you encountered? I always thought FLTK was fairly solid, though smaller than other toolkits.
sleske
+9  A: 

I don't know of any I've personally used with a C API, but wxWidgets is C++. It runs on Windows, Linux, and Mac OS X. And if you're looking for easy, wxPython is a Python wrapper around wxWidgets and it is extremely easy to use.

rmw1985
+5  A: 

I really like Qt. Have been working with it in several projects now.

Although the project, I am currently working on, will be released for windows only, some of our developers code under Mac OS X using the gcc. And using different compilers and environments is an extra benefit for locating errors & bugs.

I forgot to mention that Qt has a really good documentation including lots of practical examples that help for a quick start.

koschi
+1  A: 

The easiest to write a new program in would be the one you're most familiar with.
The easiest to use, test or distribute would probably be the most cross-platform, most distributed or the most supported one, so GTK+/wx/Qt/Tk?

Note that C itself isn't a particularly easy language, especially with the growing object-oriented approach to GUIs.

The easiest one to cook up a prototype in a scripting language, then convert to a compiled one might be any toolkit with a scripting language binding (pyGTK, wxPython, etc.)

That being said, of the "big" ones, only GTK+ and Tk have a C bindings. wxWidgets, Qt and FLTK were all written in C++ and don't have any C bindings as far as I know.

I suggest you look into learning C++ and then comparing the available options. Coding in C++ might feel like coding in a scripting language with great conveniences such as automatic pointers, utility classes and overloaded operators, non-invasive garbage collectors and easy to inherit parent classes all brought to your fingertips by the language itself and your widget toolkit.

Then my personal suggestion would be wxWidgets; quite easy to use, better documented than GTKmm and "freer" than Qt.

aib
+3  A: 

As with the other posters, I strongly recommend looking at C++ toolkits. GTK will work on Windows and the Mac OS, but will only give you truly good results on Linux. And even some of the GTK maintainers are inventing their their own object-oriented C dialect to avoid writing GUIs against the native GTK API.

As for C++, it depends on what you want. Ease of development? Native GUIs on every platform? Commercial support?

If you want native-looking GUIs on Win32 and Linux (and something semi-reasonable on the Mac), one excellent choice is wxWidgets. Here's a longer article with real-world wxWidgets experiences. The Mac port has improved substantially since 2002, when that article was written, but it still has some soft spots.

emk
Ease of development, and relatively rich - eg a table widget is essential. c++ is fine.
Stephen
wxWidgets and QT should both be on your shortlist, then. If lots of fancy, high-level widgets are more important to you than native-looking GUIs, then I'm not terribly familiar with what other options might exist. Good luck!
emk
+3  A: 

I've used both wxWidgets and QT professionally. Both are certainly capable of meeting your goals. Which one is easiest is hard to say. You don't tell us whether you're looking for easy to use, or easy to learn. Qt is easier for big programs. WxWidgets is easier to learn. This for a large part due to the signal/slot mechanism in QT, which is a good but non-intuitive architecture for large applications.

Both libraries are actually so good that I'd recommend them for non-crossplatform programming too.

MSalters
I agree with this comment, but the Qt docs are very good. The other good thing about Qt4 is the Designer application which makes a big difference. I haven't come across anything for Wx as good.
Nick
A: 

My vote goes to Qt.

Andrew Medico
+2  A: 

You might also want to refer to this similar question if you are reading these answers.

Nick