I agree GNOME community is being a bit insolent to this point.
They made GTK+ installation almost the same as the Linux installation, which is a bit like giving you pepsi in mcdonalds.
The worst is that it is forcing you to use their own crap to the extent that they even tell you what IDE to choose, how you will build your app, what will have in your app.. (Nothing personal, I will actually always prefer Linux, I'm just being unbiased)
Now to be specific, you explicitly mentioned Codeblocks.
Do not use code::block's GTK+ Project, it is awfully outdated.
You can, of course modify the script or create your own, but it is still going
to slow you down and we, programmers value our time (I think)
The procedure of installing (to this day) GTK3 ver. 3.22.16 on windows 7 for use with Code::Blocks turns out to be pretty simple.
First download MSYS2 and type within the msys2 shell:
pacman -S mingw-w64-x86_64-gtk3
(Enter y
to confirm)
Then
pacman -S mingw-w64-x86_64-toolchain base-devel
(to make sure you'll have precompiled binaries of pkg-config and to make sure you will have the latest version of gcc)
Then you have some work in CodeBlocks, first
set the new compiler, from the Codeblocks's compiler settings -> Toolchain executables. The new compiler should be located in C:\msys64\mingw64
(C or the disk you installed MSYS in)
Then link some libraries in Codeblocks's compiler settings -> Search directories:
These libraries will be enough to run this simple sample code:
#include <gtk/gtk.h>
static void activate (GtkApplication* app, gpointer user_data)
{
GtkWidget *window;
window = gtk_application_window_new(app);
gtk_window_set_title(GTK_WINDOW (window), "Window");
gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);
gtk_widget_show_all(window);
}
int main (int argc, char *argv[])
{
GtkApplication *app;
int status;
app = gtk_application_new("org.gtk.example", G_APPLICATION_FLAGS_NONE);
g_signal_connect(app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run(G_APPLICATION (app), argc, argv);
g_object_unref(app);
return status;
}
and have a result like this: