Method

GtkWidgetget_preferred_size

since: 3.0

Declaration [src]

void
gtk_widget_get_preferred_size (
  GtkWidget* widget,
  GtkRequisition* minimum_size,
  GtkRequisition* natural_size
)

Description [src]

Retrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management.

This is used to retrieve a suitable size by container widgets which do not impose any restrictions on the child placement. It can be used to deduce toplevel window and menu sizes as well as child widgets in free-form containers such as GtkLayout.

Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.

Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support baseline alignment.

Available since: 3.0

Parameters

minimum_size

Type: GtkRequisition

Location for storing the minimum size, or NULL.

The argument will be set by the function.
The argument can be NULL.
The returned data is owned by the instance.
natural_size

Type: GtkRequisition

Location for storing the natural size, or NULL.

The argument will be set by the function.
The argument can be NULL.
The returned data is owned by the instance.