Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which, if any, achieves Windows native look: GTK+, wxWidgets, Qt, FLTK?

I need to write an application that will be visually indistinguishable from something written natively for Windows XP/Vista/7 using whatever comes by default with the most modern Visual Studio. But I'm developing using MinGW and Vim (in C++).

In particular, I want the following controls to be native on the above three versions of Windows: form chrome, buttons, check boxes, menus, combo boxes, progress bars, scrollbars, rich text boxes. This will be enough for me.

I know that if you load GdiPlus and other things like riched32.dll as needed, and use Windows API to instantiate controls, then the OS will substitute its version of GdiPlus or other library, so it will look like XP style controls on XP, Vista on Vista, etc.

But I don't want to use plain Windows API, because even retrieving the default font takes half a page of code, and similar stories whatever I want to do. So I'd like to use a toolkit.

wxWidgets, Qt, GTK+, FLTK seem like the most widely used. But they are all cross-platform. I've used cross-platform applications, and many of them have foreign GUI controls (I call them widgets). So my question is: which of these toolkits can be made to produce true native-looking UI controls listed above, appearing correctly on the three versions of MSWin listed above?

I've typed each of them +" windows" into Google Images, but it's hard to tell, except that FLTK probably can't do it. Many of you must know the answer off the top of your head...

like image 799
Evgeni Sergeev Avatar asked Sep 24 '13 11:09

Evgeni Sergeev


People also ask

Does Windows use GTK or QT?

Qt is better ported for Windows and looks more native than GTK. Gimp on windows, for example, looks very strange, because most of its dialogs are not Windows dialogs. Qt can use native Window dialogs like Open/Save which makes it feel better as a framework. And yes, Qt is a framework, not only a GUI Widget.

Is wxWidgets native?

Whenever possible, wxWidgets uses the native platform SDK and system provided widgets. This means that a program compiled on Windows will have the look and feel of a Windows program, and when compiled on a Linux machine, it will get the look and feel of a Linux program.

Is QT better than wxWidgets?

One key difference between wxWidgets and Qt or GTK is that wxWidgets, as far as I know, uses native controls to create the UI, unlike Qt or GTK which draw everything themselves. Qt is really good at imitating a native feeling but wxWidgets provides a real native UX.

Does wxWidgets use GTK?

wxWidgets uses the native toolkit of the platform, (GTK on Linux, Win32 GUI API on Windows, Cocoa on MacOS X).


1 Answers

I won't talk about FLTK as I don't know it.

  • wxWidgets uses the native toolkit of the platform, (GTK on Linux, Win32 GUI API on Windows, Cocoa on MacOS X).
  • GTK uses a theming API to fake the look and feel of the platform (custom theming engine on GTK2, CSS-based engine on GTK3).
  • Qt uses styles to fake the look and feel of the platform.

wxWidgets API is quite ugly from my own experience, because it had too many method just available on one or the other platform making stuff non-portable unless you'd workaround it. Unlike GTK+ and Qt, it also adds its own layer of bugs above the toolkit it uses as a backend. However, it tries hard to have the platform's native look as it uses the native toolkit.

GTK+ 3 still has some rough edges on Windows, which it officially supports since GTK+ 3.6. The GTK+ project delegates to the MSYS2 project the distribution of Windows binaries. As you're already using MinGW, that's pretty much the same kind of environment. They have good C++ bindings with GTKmm. However, you may have some work to get the theming right for your version of Windows.

Qt is a good choice for cross-platform C++ development with the main target being Windows, tries to mimic the native look and feel of the platform but has its own theming limitations too.

To sum up, there are only 2 approches:

  • toolkits that provide their own widgets and try to look like the native platform by providing theming (GTK+ and Qt)
  • toolkits that use the native widgets but hide their API behind a layer of abstraction (wxWidgets)

Both have their pros and cons.

like image 160
liberforce Avatar answered Sep 18 '22 14:09

liberforce