Builder and Glade issues with different versions of GTK

Hi,

I’m a beginner and am using builder and glade.

On my Ubuntu (20.04) I am unable to install GTK4 for some reason, so I settled for using GTK3.

However, when I use Builder it uses GTK4 and it uses it successfully, obviously the application has its own binaries for it. I’m using the new project template for gtk, but when I try to change dependency(‘gtk4’) in the meson.build to dependency(‘gtk3’) it says gtk3 is not found, despite it being installed. Why is this?

Also, when I look at the -window.ui file in the UI designer it gives the following warning: The following required catalogues are unavailable: gtk. What is going on here?

I am a bit confused about how and where builder gets its gtk libraries .

However, when I use Builder it uses GTK4 and it uses it successfully, obviously the application has its own binaries for it. I’m using the new project template for gtk, but when I try to change dependency(‘gtk4’) in the meson.build to dependency(‘gtk3’) it says gtk3 is not found, despite it being installed. Why is this?

What you pass as a parameter to dependency is the pkg-config name. For GTK 3 and earlier, the pkg-config name was gtk+-3.0, for GTK 4, the name was simplified to gtk4. You can find that by running pkg-config --list-all | grep gtk

I am a bit confused about how and where builder gets its gtk libraries .

Builder uses Flatpak which is a container like technology. Flatpak makes use of a runtime/sdk, similar to what other platforms have like Android for example. That way you can build an application using the latest sdk without having the latest libraries installed on your host system.

If you are just starting to learn GTK, I would really recommend avoiding learning GTK 3. GTK 4 has a nicer to use API and you can do a lot more with the toolkit.

Thank you for the reply. I will begin with GTK4. A slight downside of this is that I like to program in the terminal with vim and depending on builder full-time is taking me out of my comfort zone. I’ve also jumped on the bandwagon, without any authority on the matter, of disliking flatpak and sandboxed applications. If you wish to shoot these thoughts down, that may be useful.

Also do you know anything about the Glade warning: The following required catalogues are unavailable: gtk?

Thanks again.