Basics
Guides
API Reference
Basics
Guides
API Reference
[21:7] extends: object
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 [class@Gtk.GridLayoutChild]
associated to each child widget. The behaviour of GtkGridLayout when
several children occupy the same grid cell is undefined. GtkGridLayout can
be used like a GtkBoxLayout 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 GtkBoxLayout.
GridLayout ()
Creates a new
GtkGridLayout.
toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asLayoutManager ()
Wraps this handle as
LayoutManager.
A LayoutManager object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setBaselinerow (int Value)
The row to align to the baseline, when
GtkWidget:valignis set to %GTK_ALIGN_BASELINE.
Value is the new property value.None.setColumnhomogeneous (bool Value)
Whether all the columns in the grid have the same width.
Value is the new property value.None.setColumnspacing (int Value)
The amount of space between to consecutive columns.
Value is the new property value.None.setRowhomogeneous (bool Value)
Whether all the rows in the grid have the same height.
Value is the new property value.None.setRowspacing (int Value)
The amount of space between to consecutive rows.
Value is the new property value.None.get_baseline_row ()
Retrieves the row set with gtk_grid_layout_set_baseline_row().
get_column_homogeneous ()
Checks whether all columns of @grid should have the same width.
get_column_spacing ()
Retrieves the spacing set with gtk_grid_layout_set_column_spacing().
get_row_baseline_position (int row)
Returns the baseline position of @row. If no value has been set with [method@Gtk.GridLayout.set_row_baseline_position], the default value of %GTK_BASELINE_POSITION_CENTER is returned.
row is a row index.get_row_homogeneous ()
Checks whether all rows of @grid should have the same height.
get_row_spacing ()
Retrieves the spacing set with gtk_grid_layout_set_row_spacing().
set_baseline_row (int 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.
row is the row index.None.set_column_homogeneous (bool homogeneous)
Sets whether all columns of @grid should have the same width.
homogeneous is %TRUE to make columns homogeneous.None.set_column_spacing (int spacing)
Sets the amount of space to insert between consecutive columns.
spacing is the amount of space between columns, in pixels.None.set_row_baseline_position (int row, string pos)
Sets how the baseline should be positioned on @row of the grid, in case that row is assigned more space than is requested.
row is a row index.pos is a GtkBaselinePosition.None.set_row_homogeneous (bool homogeneous)
Sets whether all rows of @grid should have the same height.
homogeneous is %TRUE to make rows homogeneous.None.set_row_spacing (int spacing)
Sets the amount of space to insert between consecutive rows.
spacing is the amount of space between rows, in pixels.None.[315:14] static extends: object
Generated metadata helpers for GridLayout class surfaces.
properties ()
Returns property metadata for
GridLayout.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.