Comparison of C/C ++ programming GUI Libraries

Source: Internet
Author: User
Tags gtk gnucash
The most powerful GUI library is QT. After all, it is a commercial product. It has the most complete functions and everything is good, including a Java code style and a good framework design. However, I would like to mention the following:

1. It does not use STL, but implements a set of alternative solutions for their own;
2. The event model uses the self-created signal/slotmechanism to pre-process the header file with javasmoc.exe;
3. The support for skin is not very good. You need to write the style class to define the paint of various controls;

Therefore, we can compare all other open-source libraries from the perspective of QT. We believe this will make the right choice for you.

1. GTK +
GTK + uses the object-oriented design method in C language. The framework is well designed and may have better performance than QT. The lgpl protocol can be used for commercial purposes. It supports theme/gtkstyle, XML-defined interfaces, Glade, and gettext, but not QT, the size of the compiled library is about 3 MB (the debug version calculates all lib values) smaller than that of QT; there is a signal mechanism similar to QT, but no pre-compilation is required. Good support for OpenGL and graphic images. GTK + is based on three libraries: glib, pango, and ATK. Glib is the underlying library that encapsulates C's data structure processing, portability, thread, dynamic loading, and an object system. Pango is a layout and text rendering library that processes fonts and internationalization. ATK is an Application Component Interface library with actions similar to QT. In addition, Cario is a vector graph processing library. Because it is C, but the Code cannot avoid macros and underscores, is not so flattering, it is estimated that C programmers are quite used.
Window = gtk_window_new (gtk_window_toplevel );
G_signal_connect (window, "Destroy", g_callback (gtk_widget_destroyed), & window); but other languages are bound. c ++ uses gtkmm and python uses pygtk, ada is adagtk. The Code style of gtkmm is good, and there is no underline or many macros. GTK +'s most famous success stories are gimp image processing tools and gnome desktops. Gimp (http://www.gimp.org/), An Image Manipulation Program
Abiword (http://www.abiword.com/), a professional word processor
DIA (http://www.lysator.liu.se /~ Alla/Dia/dia.html), a dimo-creation Program
Gnucash (http://www.gnucash.org/), a Personal Finance Manager
Gnumeric (http://www.gnome.org/projects/gnumeric/), the gnome spreadsheet application
Glade (http://glade.gnome.org/), a GTK + based rad tool which produces GTK + and gnome applications
Anjuta (http://anjuta.sourceforge.net/), a versatile integrated development environment (IDE) using C and C ++ for GTK + and gimp. GTK development framework: http://bakery.sourceforge.net/ 2. wxwidget
Wxwidget's design style is similar to MFC and lacks modern componentized design. I am not so cool to hate a bunch of macros and underscores. Like QT, it implements a set of STL alternatives. Unlike QT, it draws widgets by itself. Instead, it uses native APIs of various platforms. On some platforms, it also uses GTK +. Skin is not supported unless wxuniversal is used. The lgpl protocol can be used for commercial purposes and has complete functions. rtti/thread/Regexp/Network/OpenGL/html/ODBC supports very well, however, the interface designer wxdesigner is not free and open-source, which is extremely unpleasant. However, if you develop large cross-platform applications, it is the best choice. 3. fltkFltk prefers to develop OpenGL graphics applications. It has the interface designer fluid, which is relatively lightweight. Therefore, it does not support many functions, such as network and print. Use underscores in the code. The interface is similar to motif, which is small and fast. Lgpl protocol, but there are more restrictions (like whether to modify the source code or inherit the widget class ). Dependent on the static callback function. There is no file dialog box, and drag and clipboard are not supported. In comparison, it seems to be more stable than Fox. Similar to motif, function pointers are used to implement the signal mechanism. 4. FoxFox prefers pure GUI Libraries, so it is very lightweight and does not support internationalization, multithreading, and printing. But its code looks better than fltk. Instead of using the signal/slot mechanism, it uses its own message ing callback mechanism and can be connected and serialized at runtime. The interface is like Windows 95. Lgpl protocol, but it is not feasible to restrict your application to lgpl protocol. It does not support skin. People have been asking for it for many years! 5. the visual component framework VCF framework is well designed. Unlike QT and wxwidget, it uses STL in large quantities and has richer APIs than fltk/Fox. Unicode is used by default, supports built-in internationalization (localization) and undo/Redo mechanisms, multithreading and rtti support is also very good, it can be said that the richness of functions directly forces wxwidget and QT, the Code style is also my favorite type (using namespace and naming like Java ). It aims to use C ++ like VB, and supports rad with Visual C ++ plug-ins. Use templates and appropriate macros to implement reflection (rtti) (metaobject generation does not need to be like QT), and implement the Event System in observer mode, which is smaller than QT and MFC, about 2 m. The only thing I regret is that it is not mature enough. 6. notusThe design style is more modern framework, a lot of use of STL/Boost and template technology, if you hate hierarchies and polymorphism GUI framework, this is suitable for you.
Unfortunately, this project is not mature enough (pre-alpha ). More GUI toolkit: http://www.atai.org/guitool/ Conclusion:
1. C Programming Using GTK +
2. For large C ++ applications that use gtkmm/wxwidget, I prefer the former. Although the porting of GTK + on the Windows platform is not well supported, there must be a designer for rapid development.
3. If VCF is mature, it will be a good choice.
4. Fox is boring.
5. fltk is suitable for graphics and image programs. If it is a 3D application or game, the general game engine framework implements a built-in GUI framework, such as the nebula framework, which is very attractive; the ghost of Blender is also very good (but GPL ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.