Skip to main content


You have a #Gtk4 application, written in python with #PyGObject, which use a template to build a window.
If you define a callback in code but you do not use it in template, an exception is raised.
If you use a callback in template which is not defined in code, no errors are reported.
But.
CSS classes are not applied to widgets. 🤷

Look:
With the callback:

Without the callback:

I lost some good hours trying to find why my button was not styled.

#Gtk 4.16.5

This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website.