correct packing of a stack and its switcher depends on pack order
I've mentioned this on irc, but it deserves a more permanent note. It was first observed through ruby-gtk, but since been reproduced in python.
gtk+ 3.24.10
stack_switcher = Gtk::StackSwitcher.new
view_stack = Gtk::Stack.new
view_stack.expand = true
view_stack.add_named(elem1, 'Elem1')
view_stack.add_named(elem2, 'Elem2')
view_stack.add_named(elem3, 'Elem3')
view_stack.add_named(elem4, 'Elem4')
stack_switcher.set_stack(view_stack)
grid = Gtk::Grid.new
grid.orientation = Gtk::Orientation::VERTICAL
grid.add(stack_switcher)
grid.attach_next_to(view_stack, stack_switcher, Gtk::PositionType::TOP, 1, 1)
stack_switcher = Gtk::StackSwitcher.new
view_stack = Gtk::Stack.new
view_stack.expand = true
view_stack.add_named(elem1, 'Elem1')
view_stack.add_named(elem2, 'Elem2')
view_stack.add_named(elem3, 'Elem3')
view_stack.add_named(elem4, 'Elem4')
stack_switcher.set_stack(view_stack)
grid = Gtk::Grid.new
grid.orientation = Gtk::Orientation::VERTICAL
grid.add(view_stack)
grid.add(stack_switcher)
The two above should grant the same result, yet while the first one works, the second one results in an invisible (height 1) stack switcher.
Inspector reports: first case: left_attach/top_attach: 0/0
second case: left_attach/top_attach: 0/1