A tiny bite of GTK3

What a day it has been for me. I’m totally wasted after pretty much driving all day, I had no real plans for today either way but I wanted to get a bit of a head start with GTK3.

I’m a vim user, wait, I was a vim user. I’m not sure if it’s my disdain of spending too much time trying to get things to work but as of late Vim with YouCompleteMe has been completely crap, no iostream, no gtk, no sdl, nothing, nada. I’ve been left completely in the dark by YouCompleteMe. After some basic debugging and working with paths and realizing that compile_commands.json wasn’t making the cut as YCM wouldn’t bother checking ALL the methods available; I gave up, really. Opened CLion and with the same, unique header of #include &lt;gtk/gtk.h&gt; I was able to get all the methods, even the deprecated ones.

I hacked CMakeLists.txt to support c and find the right GTK3 headers and in less than 5 minutes I was already writing C with GTK3.

I’m honestly not sure how to feel about it. What I mean is that GTK3 design feels … weird in almost every account compared to Qt4 or Qt5. I’m more familiar with how things are laid out in Qt and this isn’t because I’ve been developing an application with Qt but because I’ve used other frameworks with a similar per module design. The classes makes sense, there’s nothing funky going out you also don’t have to write gtk_label_new() followed with a gtk_label_set_text() (yes, there’s gtk_label_new_with_text()) the whole “zen” is gone.

QLabel label("Hello");
label.setText("Hello there");

I’m biased as I like working with Qt, and not only that I’m probably being unfair as GTK3 design is meant to be different as it’s targeted (mainly) for C, and doesn’t support an object oriented approach unless you use gtkmm, which I could I guess.

This is just playing with GTK though, honestly I think I would go with Qt in the end. I WOULD like to write a minor app with Gtk3 some time in the future though.