Category : gtk

void BuilderTool::set_on_modifiers(GdkEvent* event) { int keyval = get_latin_keyval(&event->key); if (MOD__ALT(event) || keyval == GDK_KEY_Alt_L || keyval == GDK_KEY_Alt_R || keyval == GDK_KEY_Meta_L || // Meta is when you press Shift+Alt (at least on my machine) keyval == GDK_KEY_Meta_R) alt_on = true; if (MOD__CTRL(event) || keyval == GDK_KEY_Control_L || keyval == GDK_KEY_Control_R) ctrl_on = true; if ..

Read more

So I am working on my first gdk_pixbuf_module. Adding animation to the webp module. Despite trying numerous variations in the header file and c file, I keep getting these link errors that I believe are related to the gdk_pixbuf macros. My guess is I have done something simple wrong, but I cannot spot it. Help ..

Read more

I’m trying to create a window with a single Gtk::Switch with the following code: #include <gtkmm.h> #include <gtkmm/switch.h> class SimpleWindow : public Gtk::Window { public: SimpleWindow(); private: Gtk::VBox m_VBox; Gtk::Switch m_Switch; }; SimpleWindow::SimpleWindow() { set_title("Simple"); add(m_VBox); // Todo: Setup switch show_all(); } When trying to run the code, I get the following warnings and errors: ..

Read more

I am studying GTKMM 4. I decided to write a basic GTK example in C++ with GTKMM. The C example uses UI templates. As far as I understand, UI templates is a recommended way of creating GtkBuilder UI files. However, I can’t figure how to use these templates in GTKMM. Here is what the C ..

Read more

I tried to make simple application using glade and geany ide’s but can’t do naything to conect signals seted in glade to my handlers. I used this comand to build: "Short" version: gcc -Wall -w -g `pkg-config –cflags gtk+-3.0 gmodule-2.0 gmodule-export-2.0` -o "%e" "%f" `pkg-config –libs gtk+-3.0 gmodule-2.0 gmodule-export-2.0` Full comand: gcc -Wall -w -g ..

Read more

I tried to make simple application using glade and geany ide’s but can’t do nothing to connect signals set in glade to my handlers. I used this command to build: "Short" version: gcc -Wall -w -g `pkg-config –cflags gtk+-3.0 gmodule-2.0 gmodule-export-2.0` -o "%e" "%f" `pkg-config –libs gtk+-3.0 gmodule-2.0 gmodule-export-2.0` Full comand: gcc -Wall -w -g ..

Read more

Since C doesn’t support inheritance, GLib / GTK emulates it by placing base class object as the first member of derived class object. I suppose it is something like this: struct Parent { //… }; struct Child { Parent base; //… } Then we can cast child struct pointer to parent struct pointer: Child *p_child ..

Read more

I’ve installed MSYS2 on Windows 7 and I have successfully executed pacman -S mingw-w64-x86_64-gtk3 (the above as per Step 2 of Setting up GTK for Windows) and pacman -S mingw-w64-x86_64-toolchain base-devel but when I try to compile the hello world with gcc -o hello-world-gtk hello-world-gtk.c `pkg-config –cflags –libs gtk4` I get the following Package gtk4 ..

Read more

My Gtk Application has important information on the titlebar. It is a customized GtkHeaderBar, so I want it to be shown during full screen. I toggle full screen with gtk_window_unfullscreen() and gtk_window_fullscreen(). I’ve seen this happening as a window manager bug before, now I want it on purpose. Either the application should cover the taskbar ..

Read more