Method

Gtk.Widget.measure

Declaration [src]

void
gtk_widget_measure (
  GtkWidget* widget,
  GtkOrientation orientation,
  int for_size,
  int* minimum,
  int* natural,
  int* minimum_baseline,
  int* natural_baseline
)

Description [src]

Measures widget in the orientation orientation and for the given for_size.

As an example, if orientation is GTK_ORIENTATION_HORIZONTAL and for_size is 300, this functions will compute the minimum and natural width of widget if it is allocated at a height of 300 pixels.

See GtkWidget’s geometry management section for a more details on implementing GtkWidgetClass.measure().

Parameters

orientation GtkOrientation
 

the orientation to measure

for_size int
 

Size for the opposite of orientation, i.e. if orientation is GTK_ORIENTATION_HORIZONTAL, this is the height the widget should be measured with. The GTK_ORIENTATION_VERTICAL case is analogous. This way, both height-for-width and width-for-height requests can be implemented. If no size is known, -1 can be passed.

minimum int*
 

location to store the minimum size, or NULL

 Direction: out
 The called function takes ownership of the data, and is responsible for freeing it
natural int*
 

location to store the natural size, or NULL

 Direction: out
 The called function takes ownership of the data, and is responsible for freeing it
minimum_baseline int*
 

location to store the baseline position for the minimum size, or NULL

 Direction: out
 The called function takes ownership of the data, and is responsible for freeing it
natural_baseline int*
 

location to store the baseline position for the natural size, or NULL

 Direction: out
 The called function takes ownership of the data, and is responsible for freeing it