gtk.grid

Module for [Grid] class

Types 3

GtkGrid is a container which arranges its child widgets in rows and columns, with arbitrary positions and horizontal/vertical spans.

Children are added using [gtk.grid.Grid.attach]. They can span multiple rows or columns. It is also possible to add a child next to an existing child, using [gtk.grid.Grid.attachNextTo]. The behaviour of GtkGrid when several children occupy the same grid cell is undefined.

GtkGrid can be used like a #GtkBox by just using [gtk.container.Container.add], which will place children next to each other in the direction determined by the #GtkOrientable:orientation property. However, if all you want is a single row or column, then #GtkBox is the preferred widget.

CSS nodes

GtkGrid uses a single CSS node with name grid.

Methods
GType _gType() @property
Grid self()Returns `this`, for use in `with` statements.
GridGidBuilder builder()Get builder for [gtk.grid.Grid] Returns: New builder object
int baselineRow() @property
void baselineRow(int propval) @property
bool columnHomogeneous() @property
void columnHomogeneous(bool propval) @property
int columnSpacing() @property
void columnSpacing(int propval) @property
bool rowHomogeneous() @property
void rowHomogeneous(bool propval) @property
int rowSpacing() @property
void rowSpacing(int propval) @property
void attach(gtk.widget.Widget child, int left, int top, int width, int height)Adds a widget to the grid.
void attachNextTo(gtk.widget.Widget child, gtk.widget.Widget sibling, gtk.types.PositionType side, int width, int height)Adds a widget to the grid.
int getBaselineRow()Returns which row defines the global baseline of grid. Returns: the row index defining the global baseline
gtk.widget.Widget getChildAt(int left, int top)Gets the child of grid whose area covers the grid cell whose upper left corner is at left, top.
bool getColumnHomogeneous()Returns whether all columns of grid have the same width. Returns: whether all columns of grid have the same width.
uint getColumnSpacing()Returns the amount of space between the columns of grid. Returns: the column spacing of grid
gtk.types.BaselinePosition getRowBaselinePosition(int row)Returns the baseline position of row as set by [gtk.grid.Grid.setRowBaselinePosition] or the default value [gtk.types.BaselinePosition.Center].
bool getRowHomogeneous()Returns whether all rows of grid have the same height. Returns: whether all rows of grid have the same height.
uint getRowSpacing()Returns the amount of space between the rows of grid. Returns: the row spacing of grid
void insertColumn(int position)Inserts a column at the specified position.
void insertNextTo(gtk.widget.Widget sibling, gtk.types.PositionType side)Inserts a row or column at the specified position.
void insertRow(int position)Inserts a row at the specified position.
void removeColumn(int position)Removes a column from the grid.
void removeRow(int position)Removes a row from the grid.
void setBaselineRow(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 ...
void setColumnHomogeneous(bool homogeneous)Sets whether all columns of grid will have the same width.
void setColumnSpacing(uint spacing)Sets the amount of space between columns of grid.
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.
void setRowHomogeneous(bool homogeneous)Sets whether all rows of grid will have the same height.
void setRowSpacing(uint spacing)Sets the amount of space between rows of grid.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new grid widget. Returns: the new #GtkGrid

Fluent builder for [gtk.grid.Grid]

Methods