The documentation for HBox
and VBox
includes the statement:
Deprecated: Use Box instead, which is a very quick and easy change. But we recommend switching to Grid, since Box will go away eventually.
However, it isn't obvious what the "quick and easy change" should be.
How do you use Box
and/or Grid
to achieve the functionality of VBox
or HBox
?
One of the big changes in gtkmm3:
Although Grid isn't mentioned above, both containers now have a method set_orientation; Box can also take it in the constructor. So for Box, set the orientation and use your usual
pack_start
,pack_end
.With Grid, if you scrutinize the documentation, you'll see this line:
So, it should be as simple as setting the orientation and then
add
your child widgets.