GridLayout

gtk.grid_layout.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 gtk.grid_layout_child.GridLayoutChild associated to each child widget.

The behaviour of gtk.grid_layout.GridLayout when several children occupy the same grid cell is undefined.

gtk.grid_layout.GridLayout can be used like a gtk.box_layout.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 gtk.box_layout.BoxLayout.

Constructors

this
this()

Creates a new gtk.grid_layout.GridLayout.

Members

Functions

getBaselineRow
int getBaselineRow()

Retrieves the row set with gtk.grid_layout.GridLayout.setBaselineRow.

getColumnHomogeneous
bool getColumnHomogeneous()

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

getColumnSpacing
uint getColumnSpacing()

Retrieves the spacing set with gtk.grid_layout.GridLayout.setColumnSpacing.

getRowBaselinePosition
gtk.types.BaselinePosition getRowBaselinePosition(int row)

Returns the baseline position of row.

getRowHomogeneous
bool getRowHomogeneous()

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

getRowSpacing
uint getRowSpacing()

Retrieves the spacing set with gtk.grid_layout.GridLayout.setRowSpacing.

setBaselineRow
void setBaselineRow(int row)

Sets which row defines the global baseline for the entire grid.

setColumnHomogeneous
void setColumnHomogeneous(bool homogeneous)

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

setColumnSpacing
void setColumnSpacing(uint spacing)

Sets the amount of space to insert between consecutive columns.

setRowBaselinePosition
void setRowBaselinePosition(int row, gtk.types.BaselinePosition pos)

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

setRowHomogeneous
void setRowHomogeneous(bool homogeneous)

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

setRowSpacing
void setRowSpacing(uint spacing)

Sets the amount of space to insert between consecutive rows.

Inherited Members

From LayoutManager

allocate
void allocate(gtk.widget.Widget widget, int width, int height, int baseline)

Assigns the given width, height, and baseline to a widget, and computes the position and sizes of the children of the widget using the layout management policy of manager.

getLayoutChild
gtk.layout_child.LayoutChild getLayoutChild(gtk.widget.Widget child)

Retrieves a gtk.layout_child.LayoutChild instance for the gtk.layout_manager.LayoutManager, creating one if necessary.

getRequestMode
gtk.types.SizeRequestMode getRequestMode()

Retrieves the request mode of manager.

getWidget
gtk.widget.Widget getWidget()

Retrieves the gtk.widget.Widget using the given gtk.layout_manager.LayoutManager.

layoutChanged
void layoutChanged()

Queues a resize on the gtk.widget.Widget using manager, if any.

measure
void measure(gtk.widget.Widget widget, gtk.types.Orientation orientation, int forSize, int minimum, int natural, int minimumBaseline, int naturalBaseline)

Measures the size of the widget using manager, for the given orientation and size.