Package: gtk

GEnum gtk:align

Declaration

(gobject:define-genum "GtkAlign" align
  (:export t
   :type-initializer "gtk_align_get_type")
  (:fill 0)
  (:start 1)
  (:end 2)
  (:center 3)
  #+gtk-4-12
  (:baseline-fill 4)
  #-gtk-4-12
  (:baseline 4)
  #+gtk-4-12
  (:baseline-center 5))  

Values

:fill
Stretch to fill all space if possible, center if no meaningful way to stretch.
:start
Snap to left or top side, leaving space on right or bottom.
:end
Snap to right or bottom side, leaving space on left or top.
:center
Center natural width of widget inside the allocation.
:baseline-fill
A different name for baseline. Since 4.12
:baseline
Align the widget according to the baseline. Deprecated 4.12: Use :baseline-fill instead.
:baseline-center
Stretch to fill all space, but align the baseline. Since 4.12

Details

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 hexpand property inside a gtk:box widget, then the widget might get extra space. If you have for example a 16 x 16 icon inside a 32 x 32 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 the :start and :end values are interpreted relative to text direction.

The :baseline support is optional for containers and widgets, and it is only supported for vertical alignment. The :baseline-center and :baseline-fill values are treated similar to the :center and :fill values, except that it positions the widget to line up the baselines, where that is supported.
 

See also

2024-4-19