GridLayout#
Superclasses: LayoutManager, Object
GtkGridLayout 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 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.
Constructors#
- class GridLayout
- classmethod new() LayoutManager#
Creates a new
GtkGridLayout.
Methods#
- class GridLayout
- get_baseline_row() int#
Retrieves the row set with
set_baseline_row().
- get_column_spacing() int#
Retrieves the spacing set with
set_column_spacing().
- get_row_baseline_position(row: int) BaselinePosition#
Returns the baseline position of
row.If no value has been set with
set_row_baseline_position, the default value ofCENTERis returned.- Parameters:
row – a row index
- get_row_spacing() int#
Retrieves the spacing set with
set_row_spacing().
- set_baseline_row(row: int) None#
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.- Parameters:
row – the row index
- set_column_homogeneous(homogeneous: bool) None#
Sets whether all columns of
gridshould have the same width.- Parameters:
homogeneous –
Trueto make columns homogeneous
- set_column_spacing(spacing: int) None#
Sets the amount of space to insert between consecutive columns.
- Parameters:
spacing – the amount of space between columns, in pixels
- set_row_baseline_position(row: int, pos: BaselinePosition) None#
Sets how the baseline should be positioned on
rowof the grid, in case that row is assigned more space than is requested.- Parameters:
row – a row index
pos – a
GtkBaselinePosition
Properties#
- class GridLayout