Note, when implementing a gtk.Container.get a widget’s allocation will
be its “adjusted” allocation, that is, the widget’s parent
container typically calls Widget.sizeAllocate with an
allocation, and that allocation is then adjusted (to handle margin
and alignment for example) before assignment to the widget.
Widget.getAllocation returns the adjusted allocation that
was actually assigned to the widget. The adjusted allocation is
guaranteed to be completely contained within the
Widget.sizeAllocate allocation, however. So a gtk.Container
is guaranteed that its children stay inside the assigned bounds,
but not that they have exactly the bounds the container assigned.
There is no way to get the original allocation assigned by
Widget.sizeAllocate, since it isn’t stored; if a container
implementation needs that information it will have to track it itself.
Retrieves the widget’s allocation.
Note, when implementing a gtk.Container.get a widget’s allocation will be its “adjusted” allocation, that is, the widget’s parent container typically calls Widget.sizeAllocate with an allocation, and that allocation is then adjusted (to handle margin and alignment for example) before assignment to the widget. Widget.getAllocation returns the adjusted allocation that was actually assigned to the widget. The adjusted allocation is guaranteed to be completely contained within the Widget.sizeAllocate allocation, however. So a gtk.Container is guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the container assigned. There is no way to get the original allocation assigned by Widget.sizeAllocate, since it isn’t stored; if a container implementation needs that information it will have to track it itself.