Fabio<p>You have a <a href="https://social.gl-como.it/search?tag=Gtk4" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Gtk4</span></a> application, written in python with <a href="https://social.gl-como.it/search?tag=PyGObject" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PyGObject</span></a>, which use a template to build a window.<br>If you define a callback in code but you do not use it in template, an exception is raised.<br>If you use a callback in template which is not defined in code, no errors are reported.<br>But.<br>CSS classes are not applied to widgets. 🤷</p><p>Look:<br>With the callback:</p><p><br>Without the callback:</p><p><br>I lost some good hours trying to find why my button was not styled.</p><p><a href="https://social.gl-como.it/search?tag=Gtk" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Gtk</span></a> 4.16.5</p>