Enumeration (GI Enum)

Gtk-4.0GtkAlign

Controls how a widget deals with extra space in a single dimension.

Alignment only matters if the widget receives a “too large” allocation, for example if you packed the widget with the Gtk.Widget.hexpand property inside a Box, then the widget might get extra space. If you have for example a 16x16 icon inside a 32x32 space, the icon could be scaled and stretched, it could be centered, or it could be positioned to one side of the space.

Note that in horizontal context GTK_ALIGN_START and GTK_ALIGN_END are interpreted relative to text direction.

Baseline support is optional for containers and widgets, and is only available for vertical alignment. GTK_ALIGN_BASELINE_CENTER and GTK_ALIGN_BASELINE_FILL are treated similar to GTK_ALIGN_CENTER and GTK_ALIGN_FILL, except that it positions the widget to line up the baselines, where that is supported.

Index
BASELINE: 4

align the widget according to the baseline.

since 4.12: Use GTK_ALIGN_BASELINE_FILL instead

BASELINE_CENTER: 5

align the baseline.

4.12

BASELINE_FILL: 4

stretch to fill all space, but align the baseline.

4.12

CENTER: 3

center natural width of widget inside the allocation

END: 2

snap to right or bottom side, leaving space on left or top

FILL: 0

stretch to fill all space if possible, center if no meaningful way to stretch

START: 1

snap to left or top side, leaving space on right or bottom

Variables

$gtype