Here's a quick summary of what we have learned in this chapter:
With proper use of GtkHBox, GtkVBox, and a good understanding of the Expand and Fill parameter, you can achieve precise positioning, layout and sizing of the widgets in php-gtk2.
We introduced the spring box model that would allow you to easily "visualize" the effect of the expand parameter.
Whenever set_size_request() does not seem to have any effect, pack them into a GtkHBox, followed by a GtkVBox, with expand set to false.
We introduced two useful functions: spacer() and expandable_spacer().
Use spacer() for precise positioning e.g. 4 pixel gap between buttons.
Use expandable_spacer() when you want to do left/right justification, or you want a widget to stay on the top or bottom of window.
More Examples
To see how some of these techniques are being used in practice, you may refer to the following examples in the php-gtk2 Cookbook website: