LayoutManager
Superclasses: Object
Subclasses: BinLayout
, BoxLayout
, CenterLayout
, ConstraintLayout
, CustomLayout
, FixedLayout
, GridLayout
, OverlayLayout
- Constructors:
LayoutManager(**properties)
Methods
- class LayoutManager
- allocate(widget: Widget, width: int, height: int, baseline: int) None
Assigns the given
width
,height
, andbaseline
to awidget
, and computes the position and sizes of the children of thewidget
using the layout management policy ofmanager
.- Parameters:
widget – the
GtkWidget
usingmanager
width – the new width of the
widget
height – the new height of the
widget
baseline – the baseline position of the
widget
, or -1
- get_layout_child(child: Widget) LayoutChild
Retrieves a
GtkLayoutChild
instance for theGtkLayoutManager
, creating one if necessary.The
child
widget must be a child of the widget usingmanager
.The
GtkLayoutChild
instance is owned by theGtkLayoutManager
, and is guaranteed to exist as long aschild
is a child of theGtkWidget
using the givenGtkLayoutManager
.- Parameters:
child – a
GtkWidget
- get_request_mode() SizeRequestMode
Retrieves the request mode of
manager
.
- layout_changed() None
Queues a resize on the
GtkWidget
usingmanager
, if any.This function should be called by subclasses of
GtkLayoutManager
in response to changes to their layout management policies.
- measure(widget: Widget, orientation: Orientation, for_size: int) tuple[int, int, int, int]
Measures the size of the
widget
usingmanager
, for the givenorientation
and size.See the
Widget
documentation on layout management for more details.- Parameters:
widget – the
GtkWidget
usingmanager
orientation – the orientation to measure
for_size – Size for the opposite of
orientation
; for instance, if theorientation
isHORIZONTAL
, this is the height of the widget; if theorientation
isVERTICAL
, this is the width of the widget. This allows to measure the height for the given width, and the width for the given height. Use -1 if the size is not known
Virtual Methods
- class LayoutManager
- do_allocate(widget: Widget, width: int, height: int, baseline: int) None
Assigns the given
width
,height
, andbaseline
to awidget
, and computes the position and sizes of the children of thewidget
using the layout management policy ofmanager
.- Parameters:
widget – the
GtkWidget
usingmanager
width – the new width of the
widget
height – the new height of the
widget
baseline – the baseline position of the
widget
, or -1
- do_create_layout_child(widget: Widget, for_child: Widget) LayoutChild
Create a
GtkLayoutChild
instance for the givenfor_child
widget.- Parameters:
widget – the widget using the
manager
for_child – the child of
widget
- do_get_request_mode(widget: Widget) SizeRequestMode
a virtual function, used to return the preferred request mode for the layout manager; for instance, “width for height” or “height for width”; see
GtkSizeRequestMode
- Parameters:
widget
- do_measure(widget: Widget, orientation: Orientation, for_size: int) tuple[int, int, int, int]
Measures the size of the
widget
usingmanager
, for the givenorientation
and size.See the
Widget
documentation on layout management for more details.- Parameters:
widget – the
GtkWidget
usingmanager
orientation – the orientation to measure
for_size – Size for the opposite of
orientation
; for instance, if theorientation
isHORIZONTAL
, this is the height of the widget; if theorientation
isVERTICAL
, this is the width of the widget. This allows to measure the height for the given width, and the width for the given height. Use -1 if the size is not known
Fields
- class LayoutManager
- parent_instance