Layout managers are delegate classes that handle the preferred size and the allocation of a widget.
You typically subclass `GtkLayoutManager` 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.
Each `GtkWidget` can only have a `GtkLayoutManager` instance associated to it at any given time; it is possible, though, to replace the
layout manager instance using [[email protected]_layout_manager].
Layout properties
A layout manager can expose properties for controlling the layout of each child, by creating an object type derived from [
[email protected]] and installing the properties on it as normal `GObject` properties.
Each `GtkLayoutChild` instance storing the layout properties for a specific child is created through the [
[email protected]_layout_child] method; a `GtkLayoutManager` controls the creation of its `GtkLayoutChild` instances by
overriding the GtkLayoutManagerClass.create_layout_child() virtual function. The typical implementation should look like:
The [[email protected]:layout-manager] and [[email protected]:child-widget] properties on the newly created
`GtkLayoutChild` instance are mandatory. The `GtkLayoutManager` will cache the newly created `GtkLayoutChild` instance until the widget is
removed from its parent, or the parent removes the layout manager.
Each `GtkLayoutManager` instance creating a `GtkLayoutChild` should use [[email protected]_layout_child] every time it needs
to query the layout properties; each `GtkLayoutChild` instance should call [[email protected]_changed] every time a property
is updated, in order to queue a new size measuring and allocation.
publicvirtualvoidallocate (Widget widget, int width, int height, int baseline)
Assigns the given width, height, and
baseline to a widget, and computes the position and sizes of the children of the widget using the
layout management policy of this.