A widget's requisition
consists of a width and a height---the size the widget
would like to be. This is represented by a GtkRequisition struct:
typedef struct _GtkRequisition GtkRequisition;
struct _GtkRequisition
{
gint16 width;
gint16 height;
};
|
Different widgets choose what size to request in
different ways. GtkLabel,
for example, requests enough size to display all the
text in the label. Most container widgets base their
size request on the size requests of their children.
For example, if you place several buttons in a box, the
box will ask to be large enough to hold all the
buttons.
The first phase of layout starts with a toplevel widget
such as GtkWindow. Since
it's a container, GtkWindow
asks its child widget for a size request; that child
might ask its own children; and so on recursively. When
all child widgets have been queried, GtkWindow will finally get a GtkRequisition back from its
child. Depending on how it was configured, GtkWindow may or may not be able to
expand to accomodate the size request.