Gtk.GridLayout

g GObject.Object GObject.Object Gtk.LayoutManager Gtk.LayoutManager GObject.Object->Gtk.LayoutManager Gtk.GridLayout Gtk.GridLayout Gtk.LayoutManager->Gtk.GridLayout

Subclasses:

None

Methods

Inherited:

Gtk.LayoutManager (6), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_baseline_row ()

get_column_homogeneous ()

get_column_spacing ()

get_row_baseline_position (row)

get_row_homogeneous ()

get_row_spacing ()

set_baseline_row (row)

set_column_homogeneous (homogeneous)

set_column_spacing (spacing)

set_row_baseline_position (row, pos)

set_row_homogeneous (homogeneous)

set_row_spacing (spacing)

Virtual Methods

Inherited:

Gtk.LayoutManager (6), GObject.Object (7)

Properties

Name

Type

Flags

Short Description

baseline-row

int

r/w/en

column-homogeneous

bool

r/w/en

column-spacing

int

r/w/en

row-homogeneous

bool

r/w/en

row-spacing

int

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gtk.GridLayout(**kwargs)
Bases:

Gtk.LayoutManager

Abstract:

No

Structure:

Gtk.GridLayoutClass

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 [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.

classmethod new()[source]
Returns:

the newly created GtkGridLayout

Return type:

Gtk.LayoutManager

Creates a new GtkGridLayout.

get_baseline_row()[source]
Returns:

the global baseline row

Return type:

int

Retrieves the row set with Gtk.GridLayout.set_baseline_row().

get_column_homogeneous()[source]
Returns:

True if the columns are homogeneous, and False otherwise

Return type:

bool

Checks whether all columns of self should have the same width.

get_column_spacing()[source]
Returns:

the spacing between consecutive columns

Return type:

int

Retrieves the spacing set with Gtk.GridLayout.set_column_spacing().

get_row_baseline_position(row)[source]
Parameters:

row (int) – a row index

Returns:

the baseline position of row

Return type:

Gtk.BaselinePosition

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.BaselinePosition.CENTER is returned.

get_row_homogeneous()[source]
Returns:

True if the rows are homogeneous, and False otherwise

Return type:

bool

Checks whether all rows of self should have the same height.

get_row_spacing()[source]
Returns:

the spacing between consecutive rows

Return type:

int

Retrieves the spacing set with Gtk.GridLayout.set_row_spacing().

set_baseline_row(row)[source]
Parameters:

row (int) – the row index

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 self.

set_column_homogeneous(homogeneous)[source]
Parameters:

homogeneous (bool) – True to make columns homogeneous

Sets whether all columns of self should have the same width.

set_column_spacing(spacing)[source]
Parameters:

spacing (int) – the amount of space between columns, in pixels

Sets the amount of space to insert between consecutive columns.

set_row_baseline_position(row, pos)[source]
Parameters:

Sets how the baseline should be positioned on row of the grid, in case that row is assigned more space than is requested.

set_row_homogeneous(homogeneous)[source]
Parameters:

homogeneous (bool) – True to make rows homogeneous

Sets whether all rows of self should have the same height.

set_row_spacing(spacing)[source]
Parameters:

spacing (int) – the amount of space between rows, in pixels

Sets the amount of space to insert between consecutive rows.

Property Details

Gtk.GridLayout.props.baseline_row
Name:

baseline-row

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The row to align to the baseline, when GtkWidget:valign is set to Gtk.Align.BASELINE.

Gtk.GridLayout.props.column_homogeneous
Name:

column-homogeneous

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether all the columns in the grid have the same width.

Gtk.GridLayout.props.column_spacing
Name:

column-spacing

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The amount of space between to consecutive columns.

Gtk.GridLayout.props.row_homogeneous
Name:

row-homogeneous

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether all the rows in the grid have the same height.

Gtk.GridLayout.props.row_spacing
Name:

row-spacing

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The amount of space between to consecutive rows.