It was suggested I could build my own Gtk 4 compiler using the open source code, however when I attempted to do that, I kept getting additional errors. When I mentioned this in the Gtk forum, I pointed out that Gtk 3.0 was supported, but I was told this is likely because Gtk 3.0 had been out for nearly a decade. Now, with the release of Gtk 4.0, I hear it is currently unavailable for Debian (Raspberry Pi Os) and the following command fails: Still, I was able to press on, ending up with a fairly impressive application. The only struggle was the abundance of library functions that were deprecated.
GTK 2.0 INSTALL
I was able to use the above instead (sudo apt-get install libgtk-3-dev) and it worked great. I first got started using Simon Long’s “C & GUI Programming” book which referenced Gtk 2.0 and provided a command to install that is similar to the above (sudo apt-get install libgtk-2-dev). This it, add this to your project source file and off you go. For subsequent ones you can simply 'duplicate' and then 'edit' to add each as a new entry. For the first one you can paste the line in even though an open file dialog is shown but you may need to go back and edit it to make it right. Go to: Project Properties > Build > C++ Compiler > General > Include Directories > and add in each one. usr/lib/arm-linux-gnueabihf/glib-2.0/include usr/lib/arm-linux-gnueabihf/dbus-1.0/include pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/includeĬonvert it into a list of directories and delete any duplicates, so you end up with something like this: Now you need to add all of the directories used by the gtk libraries – dull but necessary... Use this command: Note the single quote marks are correct and should be used as is! `pkg-config –cflags gtk+-3.0` `pkg-config –libs gtk+-3.0` Go to: Project Properties > Build > Linker > Compilation Line > Additional Options > paste in this: Include gtk and get programming – see here. button removed, preview happens immediately when a selection is made.Update your makefile to use the gtk libs and cflags:.Integrate the preview into the main window, putting the selection and preview controls in tabs.The dialog window updates itself as a preview rather than opening a separate window.Theme names are presented in a scrollable list rather than a combobox.Theme directories that do not contain a gtk+ theme are not offered for selection.Lots of minor improvements for the demo tab.
GTK 2.0 CODE
Massive code cleanup and reorganization.Thanks to help from Andre Costa and Pascal Bleser, RPM packages are now available.Made all widgets in preview pane unfocussable with keyboard.Added disabling of font clear button fixes segfault when clicked before any theme selected.Added blocking of main window when font dialog is shown.Renamed all references to “demo” to “preview.”.Removed notebook, moved preview panel onto main view, removed textarea from preview panel.Removed clearing of font upon theme selection change.Another major code reorganization, some cleanup ensued.Fixes for a number of a packaging glitches.This is why I decided to opt for a new name. It was originally derived from Gtk Theme Switch, but what started out as a hack to remove various nuisances now shares no code whatsoever anymore with the original. For a comprehensive demonstration there’s a large variety of widgets. Themes installed on the system are presented for selection and previewed on the fly. The aim is to make theme preview and selection as slick as possible. As the name suggests, this little program lets you change your gtk+ 2.0 theme.