enum Gtk::Align

Overview

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.

%GTK_ALIGN_BASELINE support is optional for containers and widgets, and it is only supported for vertical alignment. When it's not supported by a child or a container it is treated as %GTK_ALIGN_FILL.

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/gtk.cr

Enum Members

Fill = 0_u32

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

Start = 1_u32

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

End = 2_u32

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

Center = 3_u32

center natural width of widget inside the allocation

Baseline = 4_u32

align the widget according to the baseline. See Gtk::Widget.

Class Method Summary

Instance Method Summary

Class methods inherited from struct Enum

g_type : UInt64 g_type

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


Instance Method Detail

def baseline? #

def center? #

def end? #

def fill? #

def start? #