Gtk+ 3 had an pack-type packing property which allowed to put an child to the other side of an GtkBox.
Since packing is now removed in GTK4, what would the ideal way of putting an item to the other side of an GtkBox?
I have seen some people using hexpand and halign, but that seems like an workaround rather than a solution…
The pack-type child property had various downsides, including the fact that it wasn’t immediately clear how it would interact with the styling system until the very end of the layout, and it complicated the layout machinery itself. The position in the box should not be controlled by a layout propery: it should be the index of the child widget.
Why would it be a workaround, when it’s precisely what the API is meant to be doing? The alignment flags control how a widget should occupy the area allocated by its parent; the expansion flags control whether a widget should be allocated that area in the first place.
Sometimes to control the layout of the widgets inside a container you have to create dummy objects whose sole role are to occupy space or expand to push other objects to the end. Like here.