CustomLayout#
Superclasses: LayoutManager, Object
GtkCustomLayout uses closures for size negotiation.
A GtkCustomLayoutuses closures matching to the old GtkWidget
virtual functions for size negotiation, as a convenience API to
ease the porting towards the corresponding `GtkLayoutManager
virtual functions.
Constructors#
- class CustomLayout
- classmethod new(request_mode: Callable[[Widget], SizeRequestMode] | None, measure: Callable[[Widget, Orientation, int], tuple[int, int, int, int]], allocate: Callable[[Widget, int, int, int], None]) LayoutManager#
Creates a new legacy layout manager.
Legacy layout managers map to the old
GtkWidgetsize negotiation virtual functions, and are meant to be used during the transition from layout containers to layout manager delegates.- Parameters:
request_mode – a function to retrieve the
GtkSizeRequestModeof the widget using the layout; the default request mode isCONSTANT_SIZEmeasure – a function to measure the widget using the layout manager
allocate – a function to allocate the children of the widget using the layout manager