Package: gtk

Function gtk:widget-allocation

Lambda List

gtk:widget-allocation (widget)

Arguments

widget -- a gtk:widget object

Return Value

The gdk:rectangle instance with the allocation.

Details

Retrieves the allocation of the widget. Note, when implementing a layout container: an allocation of the widget will be its "adjusted" allocation, that is, the parent of the widget typically calls the gtk:widget-size-allocate function with an allocation, and that allocation is then adjusted (to handle margin and alignment for example) before assignment to the widget. The gtk:widget-allocation function returns the adjusted allocation that was actually assigned to the widget. The adjusted allocation is guaranteed to be completely contained within the gtk:widget-size-allocate allocation, however.

So a layout container is guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the container assigned.

Notes

In the Lisp binding to GTK this function does not return an allocation of type GtkAllocation, but a gdk:rectangle instance. In the C implementation the GtkAllocation type is a synonym for the gdk:rectangle type.

Warning

This function is deprecated since 4.12. Use the gtk:widget-compute-bounds, gtk:widget-width, or gtk:widget-height functions instead.
 

See also

#2025-2-15