RSS Feed

Tag Archives: gtk

A brief comparison of GTK+ and Qt


I used to like C language, because it is a basic of programming, and it is portable, and it is low-level. When writing program with C language, it is just like showing off your advanced programming skill, how you manage the memory, how you manage the pointers and creating the linked list. However, in terms of efficiency, C++ is much more powerful, because of object-oriented and the syntax.

Because I like C language, so I chose GTK+ over Qt for long time ago. Not only that, I am also fond of GTK+ desktop environments like GNOME, Xfce4, LXDE, Cinnamon, but not Mate. I feel that KDE is heavy weight.

One of my personal projects, Med, which was written with GTK+, had some issues with multi-threading. I believe that my engine part does not have any problem. As a result, the suspicious part is the GTK+. The program crash without symptoms, and difficult to reproduce. Therefore, I decided to re-write the UI with Qt. If, Qt also produces the same problem, meaning my algorithm is problematic.

In my opinion, GTK+ is straight forward, because of procedural paradigm. Therefore, it is easy to learn and implement. The UI can be design with Glade. But I feel that it is still lack of something, such as button click callback function. Besides that, though there is gtkmm (C++ interface of GTK+), the library like WebKitGTK+ does not have the documentation for gtkmm (I believe still can work). In summary, GTK+ is slower as writing the code in C language.

On the other hand, Qt is more complicated. To use it, better to use qmake project file to generate the Makefile, or use the CMake, so that we can include the necessary headers and link with necessary libraries. And we also need to use some macro. This makes me feel that the coding is very Qt-oriented, not just a C++ language. However, in terms of design, I feel that Qt Designer is much easier. But GTK+ and Qt layout uses different concept.

Though GTK+ and Qt are both object oriented, GTK+ is in the library level yet Qt is in the language level. It is easier to write inherited classes in Qt, and easily make changes at the language level.

As a conclusion, Qt is better than GTK+ for development as C++ is better than C.

Running Mono (C#) pre-compiled by Linux in Windows


Finally, I success to run Mono with GTK# pre-compiled by Linux in Windows.

Firstly, make sure Windows is installed with

With the above installation, one can run the Mono application normally. I failed previously because I didn’t install GTK# for .NET.

However, when I run the application, there is a console window, which is annoyance. Thus, build the Mono application with

gmcs yoursource.cs -pkg:gtk-sharp-2.0 -target:winexe

By using “-target:winexe”, there will be no console window.

Yes, this is a light for me for cross-platform software development. Though I haven’t tried this on Mac OS X, but hopefully it works. I found that Mono is better than Java. Mono GTK# unlike Java Swing which cause me a lot of troubles. Java Swing though can run in cross-platform, it produces unexpected GUI differences. (Such as running GridBagLayout of Java in Ubuntu. One can give a try with Password Cipher Java Edition). I think I will move to Mono with GTK# instead of Java.

Prayer Clock and JPrayer Clock 0.1.2 released

Posted on

Prayer Clock and JPrayer Clock 0.1.2 are released. Anyone who likes, you can download. And the source code is also available. Feel free to edit.