About all my projects
Gnome::Gtk4::BoxLayout

Gnome::Gtk4::BoxLayout

Description

Gnome::Gtk4::BoxLayout is a layout manager that arranges children in a single row or column.

Whether it is a row or column depends on the value of its orientation defined in Gnome::Gtk4::R-Orientable property. Within the other dimension all children all allocated the same size. The Gnome::Gtk4::BoxLayout will respect the halign defined in Gnome::Gtk4::Widget and valign defined in Gnome::Gtk4::Widget properties of each child widget.

If you want all children to be assigned the same size, you can use the homogeneous property.

If you want to specify the amount of space placed between each child, you can use the spacing property.

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-boxlayout

Creates a new Gnome::Gtk4::BoxLayout.

method new-boxlayout ( GtkOrientation $orientation --> Gnome::Gtk4::BoxLayout \)
  • $orientation; the orientation for the new layout.

Methods

get-baseline-child

Gets the value set by .set-baseline-child().

method get-baseline-child (--> Int )

Return value; the index of the child that determines the baseline in vertical layout, or -1.

get-baseline-position

Gets the value set by .set-baseline-position().

method get-baseline-position (--> GtkBaselinePosition )

Return value; the baseline position.

get-homogeneous

Returns whether the layout is set to be homogeneous.

method get-homogeneous (--> Bool )

Return value; True if the layout is homogeneous.

get-spacing

Returns the space that $box-layout puts between children.

method get-spacing (--> UInt )

Return value; the spacing of the layout.

set-baseline-child

Sets the index of the child that determines the baseline in vertical layout.

method set-baseline-child ( Int() $child )
  • $child; the child position, or -1.

set-baseline-position

Sets the baseline position of a box layout.

The baseline position affects only horizontal boxes with at least one baseline aligned child. If there is more vertical space available than requested, and the baseline is not allocated by the parent then the given $position is used to allocate the baseline within the extra space available.

method set-baseline-position ( GtkBaselinePosition $position )
  • $position; a enumeration GtkBaselinePosition defined in Gnome::Gtk4::T-enums.

set-homogeneous

Sets whether the box layout will allocate the same size to all children.

method set-homogeneous ( Bool() $homogeneous )
  • $homogeneous; True to set the box layout as homogeneous.

set-spacing

Sets how much spacing to put between children.

method set-spacing ( UInt() $spacing )
  • $spacing; the spacing to apply between children.