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 _getGType() static nothrow
GType _gType() @property nothrow
Grid self() nothrowReturns `this`, for use in `with` statements.
GridGidBuilder builder() static nothrowGet builder for [gtk.grid.Grid] Returns: New builder object
int baselineRow() @property nothrow
void baselineRow(int propval) @property nothrow
bool columnHomogeneous() @property nothrow
void columnHomogeneous(bool propval) @property nothrow
int columnSpacing() @property nothrow
void columnSpacing(int propval) @property nothrow
bool rowHomogeneous() @property nothrow
void rowHomogeneous(bool propval) @property nothrow
int rowSpacing() @property nothrow
void rowSpacing(int propval) @property nothrow
void attach(gtk.widget.Widget child, int left, int top, int width, int height) nothrowAdds a widget to the grid.
void attachNextTo(gtk.widget.Widget child, gtk.widget.Widget sibling, gtk.types.PositionType side, int width, int height) nothrowAdds a widget to the grid.
int getBaselineRow() nothrowReturns which row defines the global baseline of grid. Returns: the row index defining the global baseline
gtk.widget.Widget getChildAt(int left, int top) nothrowGets the child of grid whose area covers the grid cell whose upper left corner is at left, top.
bool getColumnHomogeneous() nothrowReturns whether all columns of grid have the same width. Returns: whether all columns of grid have the same width.
uint getColumnSpacing() nothrowReturns the amount of space between the columns of grid. Returns: the column spacing of grid
gtk.types.BaselinePosition getRowBaselinePosition(int row) nothrowReturns the baseline position of row as set by [gtk.grid.Grid.setRowBaselinePosition] or the default value [gtk.types.BaselinePosition.Center].
bool getRowHomogeneous() nothrowReturns whether all rows of grid have the same height. Returns: whether all rows of grid have the same height.
uint getRowSpacing() nothrowReturns the amount of space between the rows of grid. Returns: the row spacing of grid
void insertColumn(int position) nothrowInserts a column at the specified position.
void insertNextTo(gtk.widget.Widget sibling, gtk.types.PositionType side) nothrowInserts a row or column at the specified position.
void insertRow(int position) nothrowInserts a row at the specified position.
void removeColumn(int position) nothrowRemoves a column from the grid.
void removeRow(int position) nothrowRemoves a row from the grid.
void setBaselineRow(int row) nothrowSets 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) nothrowSets whether all columns of grid will have the same width.
void setColumnSpacing(uint spacing) nothrowSets the amount of space between columns of grid.
void setRowBaselinePosition(int row, gtk.types.BaselinePosition pos) nothrowSets 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) nothrowSets whether all rows of grid will have the same height.
void setRowSpacing(uint spacing) nothrowSets 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 implementation template for gtk.grid.Grid

Methods
T baselineRow(int propval) nothrow
T columnHomogeneous(bool propval) nothrow
T columnSpacing(int propval) nothrow
T rowHomogeneous(bool propval) nothrow
T rowSpacing(int propval) nothrow

Fluent builder for gtk.grid.Grid

Methods
Grid build() nothrowCreate object from builder. Returns: New object