[ACCEPTED]-Your best library for create GUI ( gtk, qt, win32 api, etc )?-gtk

Accepted answer
Score: 30

If you are making the gui only for windows, I 17 would strongly recommend WIN 32 Api. I have 16 Made many applications in GTK+ , pyGtk , FLTK 15 and have learned Qt, MFC and SmartWin++. Believe 14 me , But I like Win32 Api the best. It may 13 have a steep learning curve, but for creating 12 native windows applications , it is the 11 fastest and the BEST. And the more complex 10 youre program gets, the easier Win32 Api 9 is compared to other toolkits. And there 8 are things you can do in Win32 Api, which 7 you can not do in any other toolkit.

TESTED:

starting 6 time (simple gui with menu and buttons): GTK+ = 7 5 secs; Qt = 4 secs; WxWidgets = 3.32 seconds; FLTK 4 = 1 second; Win32 Api = 0.34 seconds;

space 3 taken: Gtk+ = 132 kb; Qt = 4.5 mb; WxWidgets 2 = 4.5 mb; FLTK = 54 kb; Win32 Api = 6.5 1 kb;

Score: 20

Let's see.

  • Win32 is very low-level, C based, and awkward to use.
  • MFC is considered obsolete.
  • C# (or C++) with .NET is probably your primary choice for Windows-specific development.
    • There are even semi-limited ways to port that code to other platforms (Mono).
  • Java is great for very platform-independent code that "just runs". Sorry, you said C++.
  • QT is relatively platform-independent.
  • GTK+, of course, although I personally don't have much experience with it.

Personally, if I do something 6 Windows-specific, I use .NET - the tools 5 in Visual Studio are very powerful, and 4 it's a great all-encompassing suite.

For 3 platform-independent stuff, I use Java, but 2 that may not be your tool of choice. I've 1 seen QT used a lot for that purpose.

Score: 16

You really have a lot of GUI toolkits/frameworks 35 to choose from: Qt, wxWidgets, GTK+/gtkmm, WinAPI, MFC, .NET 34 WinForms/WPF... and those are only the popular 33 ones.

Since you limit yourself to C++, I'd 32 strike out .NET because C++ on .NET is intended 31 to serve as a connection between the unmanaged 30 and managed world. That doesn't mean you 29 can't use it for other types of development, but 28 given the awkward syntax and countless pitfalls 27 I'd not go with it. Moreover, the WinForms 26 code generator of VS puts the forms' code 25 into the header file.. brrrr

As others have stated, WinAPI 24 is written in C, very fast and powerful, but 23 very low level and not easy to program/learn. MFC 22 would be an option since it's written in 21 C++, easier to use than WinAPI and also 20 very powerful. However, it's pretty much 19 obsolete (due to the presence of .NET, mostly).

I 18 wouldn't recommend GTK+/gtkmm (a C++ wrapper 17 for GTK+) for Windows since you don't get the native 16 windows look, it's rather annoying to set 15 up on your developer machine and it also 14 drags around tons of dependencies that you 13 have to install on the user machine. That's 12 actually a pity because especially gtkmm 11 has a very beautiful class hierarchy and 10 design. Probably one of the best designed 9 GUI libraries :)

That said, what would I 8 recommend? Either Qt or wxWidgets. Both 7 are written in (fairly modern) C++, actively 6 developed, have a good library design, run 5 multi-platform and offer lots of functionality. In 4 any case, play around with a few of the 3 libraries listed in the answers here and 2 see which one lets you do the things you 1 want to do most easily :)

Score: 8

win32 api is too complicated, MFC is too 6 annoying. I have used MFC, win32api, and 5 Qt in windows. In my opnion, Qt is the best 4 one. I havent tried GTK, so sorry knowing 3 nothing about it.

Edit 2019: It looks all 2 these options are outdated, how about the cross-platform 1 solutions, react-native windows, electron

Score: 8

both are for c, but there is a good wrapper 10 for gtk (gtkmm).

gtk has its own look, so 9 theres no skinning of ui elements on the 8 user side(with windows styles). but i like 7 to programm with it more.

win32, mfc, .net 6 are mostly limited to ms visual studio, while 5 gtk is very hard to use with vs.

you should 4 have a look on win32, .net, gtkmm and qt. just 3 try to write and compile a simple hello 2 world program with them

upsides of win32:

  • native windows code
  • fast

downsides:

  • no classes, only c with handles (very crappy)
  • in my opinion very bad documented

upsides 1 of gtk(mm):

  • easy to learn/programm
  • good documented

downsides:

  • somehow difficult to install the development files
  • no native windows look
Score: 5

If Linux (or Mac) compatibility is your 1 concern, then Qt. Else Win32.

Score: 5

I have used GTK+ in the past for a multi-platform 10 application. I found it relatively simple 9 to learn and use. To my mind the main advantage 8 of GTK+ is that you will be able to port 7 your application to other windowing systems. And 6 the main disadvantage is that it will not 5 look exactly like other windows applications. If 4 you are doing cross platform work or are 3 already very familiar with GTK+ (and don't 2 have time to spend learning a new toolkit), I 1 would recommend it.

Score: 5

Personally I prefer Qt, but it really depends 18 on what kind of user interfaces you want 17 to make.

Against Win32:

  • low-level, high complexity 16 to accomplish trivial things. You have to 15 do EVERYTHING

  • if you go this route I would 14 recomment a book like the one from Petzold.

Pro 13 Qt:

  • Good looking GUIs

  • Can change the look 12 and feel very easily by creating stylesheets

  • Signal 11 and slots mechanism notifies you of UI events 10 such as "button clicked" etc.

  • Nice 9 layout system

  • Integrated with Visual Studio 8 IDE

  • Modern object oriented c++ code, easy 7 to understand and use

  • Qt Assistant (Very 6 good documentation)

  • Relatively liberal licensing 5 (LGPL)

  • Qt Designer - WYSIWYG design tool 4 you can use for form design

  • Comes with a 3 wealth of other c++ functionality including 2 XML, networking, eventloops, threading, database 1 access, etc

Against Qt:

  • Intermediary step of using MOC compiler

Pro WPF:

  • if you want the new WPF capabilities of the new Windows platforms, WPF is the way to go.
Score: 2

You may want to try Winforms or WPF. If 4 you're limited to using C/C++, you can embed 3 .NET code using the /clr option for the 2 compiler to embed .NET code for Winforms 1 or WPF. Sources:

http://msdn.microsoft.com/en-us/library/k8d11d4s(VS.71).aspx
http://msdn.microsoft.com/en-us/library/ms754130.aspx
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspx
Personal experience

Score: 2

For platform independent development, I 4 would recommend Qt instead of the current 3 GTK. GTK2 drawing was very slow compared 2 to Qt as well as Win32. If you love native 1 look feel, wxWidgets is made for you.

More Related questions