In Gtk3, GtkStackSwitcher inherits GtkBox which has a homogeneous property. In Gtk4, GtkStackSwitcher inherits GtkWidget directly and lose this property. Evince use this property to implement its sidebar. And the general question is how do I set properties (such like hexpand halign) for GtkButton managed by GtkStackSwitcher.
how do I set properties (such like hexpand halign) for GtkButton managed by GtkStackSwitcher.
You can’t. Even in GTK3 those buttons were an implementation detail and not a part of the API - in other words if the internal layout changes and your app breaks, it’s your fault.
You can still get them via gtk_widget_get_first_child() etc, but don’t.
Evince use this property to implement its sidebar.
What are you trying to achieve? If you’re trying to get a switcher to expand, I think it would make sense to do that unconditionally in GtkStackSwitcher itself, so that halign=fill actually works.