Easiest cross platform widget toolkit? [closed]

2019-03-27 16:13发布

问题:

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.

回答1:

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.



回答2:

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.



回答3:

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.



回答4:

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/



回答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.



回答6:

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.