Phase two of layout begins at this point. GtkWindow makes a decision about how
much space is actually available for its child, and
communicates its decision to the child. This is known
as the child's allocation,
represented by the following struct:
typedef struct _GtkAllocation GtkAllocation;
struct _GtkAllocation
{
gint16 x;
gint16 y;
guint16 width;
guint16 height;
};
|
The width and height elements are identical
to GtkRequisition; they
represent the size of the widget. A GtkAllocation also includes the
coordinates of the child with respect to its parent.
GtkAllocations are
assigned to children by their parent container.
Widgets are required to honor the GtkAllocation given to them. GtkRequisition is only a
request; widgets must be able to cope with any size.
Given the layout process, it's easy to see what role
containers play. Their job is to assemble each child's
requisition into a single requisition to be passed up
the widget tree; then to divide the allocation they
receive between their children. Exactly how this
happens depends on the particular container.