public abstract class LayoutManager : Object
Layout managers are delegate classes that handle the preferred size and the allocation of a container widget.
You typically subclass LayoutManager if you want to implement a layout policy for the children of a widget, or if you want to determine the size of a widget depending on its contents.
A layout manager can expose properties for controlling the layout of each child, by creating an object type derived from LayoutChild and installing the properties on it as normal GObject properties.
Each LayoutChild instance storing the layout properties for a specific child is created through the get_layout_child method; a LayoutManager controls the creation of its LayoutChild instances by overriding the GtkLayoutManagerClass.create_layout_child() virtual function. The typical implementation should look like:
static GtkLayoutChild *
create_layout_child (GtkLayoutManager *manager,
return g_object_new (your_layout_child_get_type (),
The layout_manager and child_widget properties on the newly created LayoutChild instance are mandatory. The LayoutManager will cache the newly created LayoutChild instance until the widget is removed from its parent, or the parent removes the layout manager.
Each LayoutManager instance creating a LayoutChild should use get_layout_child every time it needs to query the layout properties; each LayoutChild instance should call layout_changed every time a property is updated, in order to queue a new size measuring and allocation.