7

What is the easiest cross platform widget toolkit? I'm looking for one that minimally covers Windows, OSX, and Linux with a C or C++ interface.

Brian
  • 14,610
  • 7
  • 35
  • 43
Stephen
  • 1,215
  • 2
  • 25
  • 40
  • responding to EMK & others -> Ease of development is the priority and relatively rich set - eg a table widget is essential. c++ is fine. – Stephen Sep 18 '08 at 12:38
  • You might also want to refer to [this similar question](http://stackoverflow.com/questions/610/gui-programming-apis) if you are reading these answers. – Nick Sep 22 '08 at 13:51

6 Answers6

11

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 pretty easy to use.

Richard Waite
  • 907
  • 9
  • 15
9

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.

Thomas Koschel
  • 3,321
  • 9
  • 33
  • 38
  • i also worked with qt - it was great fun (and i hat c and c++). i never saw a better documented (contentent and look and feel) api. – dermoritz Jun 14 '12 at 09:56
6

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
  • 173,980
  • 10
  • 155
  • 350
  • 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 Sep 22 '08 at 13:49
5

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
  • 2,593
  • 1
  • 21
  • 27
  • 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 Sep 18 '08 at 14:53
  • 1
    I worked on a large cross-platform application that used FLTK and we wished we hadn't. Save it for smaller stuff. – Justsalt Sep 19 '08 at 19:27
  • @Justsalt: Interesting. Could you explain what problems you encountered? I always thought FLTK was fairly solid, though smaller than other toolkits. – sleske Jul 06 '10 at 12:14
5

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
  • 60,150
  • 6
  • 45
  • 50
  • Ease of development, and relatively rich - eg a table widget is essential. c++ is fine. – Stephen Sep 18 '08 at 12:37
  • 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 Sep 18 '08 at 13:09
1

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
  • 45,516
  • 10
  • 73
  • 79