Gnome::Gtk4::GridLayout
Description
Gnome::Gtk4::GridLayout is a layout manager which arranges child widgets in rows and columns.
Children have an "attach point" defined by the horizontal and vertical index of the cell they occupy; children can span multiple rows or columns. The layout properties for setting the attach points and spans are set using the Gnome::Gtk4::GridLayoutChild associated to each child widget.
The behaviour of Gnome::Gtk4::GridLayout when several children occupy the same grid cell is undefined.
Gnome::Gtk4::GridLayout can be used like a Gnome::Gtk4::BoxLayout if all children are attached to the same row or column; however, if you only ever need a single row or column, you should consider using Gnome::Gtk4::BoxLayout.
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-gridlayout
Creates a new Gnome::Gtk4::GridLayout.
method new-gridlayout ( --> Gnome::Gtk4::GridLayout \)
Methods
get-baseline-row
Retrieves the row set with .set-baseline-row()
.
method get-baseline-row (--> Int )
Return value; the global baseline row.
get-column-homogeneous
Checks whether all columns of $grid
should have the same width.
method get-column-homogeneous (--> Bool )
Return value; True
if the columns are homogeneous, and False
otherwise.
get-column-spacing
Retrieves the spacing set with .set-column-spacing()
.
method get-column-spacing (--> UInt )
Return value; the spacing between consecutive columns.
get-row-baseline-position
Returns the baseline position of $row
.
If no value has been set with .set-row-baseline-position()
, the default value of GTK_BASELINE_POSITION_CENTER
is returned.
method get-row-baseline-position ( Int() $row --> GtkBaselinePosition )
$row; a row index.
Return value; the baseline position of $row
.
get-row-homogeneous
Checks whether all rows of $grid
should have the same height.
method get-row-homogeneous (--> Bool )
Return value; True
if the rows are homogeneous, and False
otherwise.
get-row-spacing
Retrieves the spacing set with .set-row-spacing()
.
method get-row-spacing (--> UInt )
Return value; the spacing between consecutive rows.
set-baseline-row
Sets which row defines the global baseline for the entire grid.
Each row in the grid can have its own local baseline, but only one of those is global, meaning it will be the baseline in the parent of the $grid
.
method set-baseline-row ( Int() $row )
$row; the row index.
set-column-homogeneous
Sets whether all columns of $grid
should have the same width.
method set-column-homogeneous ( Bool() $homogeneous )
$homogeneous;
True
to make columns homogeneous.
set-column-spacing
Sets the amount of space to insert between consecutive columns.
method set-column-spacing ( UInt() $spacing )
$spacing; the amount of space between columns, in pixels.
set-row-baseline-position
Sets how the baseline should be positioned on $row
of the grid, in case that row is assigned more space than is requested.
method set-row-baseline-position ( Int() $row, GtkBaselinePosition $pos )
$row; a row index.
$pos; a
enumeration GtkBaselinePosition defined in Gnome::Gtk4::T-enums
.
set-row-homogeneous
Sets whether all rows of $grid
should have the same height.
method set-row-homogeneous ( Bool() $homogeneous )
$homogeneous;
True
to make rows homogeneous.
set-row-spacing
Sets the amount of space to insert between consecutive rows.
method set-row-spacing ( UInt() $spacing )
$spacing; the amount of space between rows, in pixels.