GridLayout

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.

Constructors

this
this(GtkGridLayout* gtkGridLayout, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new GtkGridLayout.

Members

Functions

getBaselineRow
int getBaselineRow()

Retrieves the row set with gtk_grid_layout_set_baseline_row().

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_set_column_spacing().

getGridLayoutStruct
GtkGridLayout* getGridLayoutStruct(bool transferOwnership)

Get the main Gtk struct

getRowBaselinePosition
GtkBaselinePosition 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_set_row_spacing().

getStruct
void* getStruct()

the main Gtk struct as a void*

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, GtkBaselinePosition 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.

Static functions

getType
GType getType()

Variables

gtkGridLayout
GtkGridLayout* gtkGridLayout;

the main Gtk struct

Inherited Members

From LayoutManager

gtkLayoutManager
GtkLayoutManager* gtkLayoutManager;

the main Gtk struct

getLayoutManagerStruct
GtkLayoutManager* getLayoutManagerStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
allocate
void allocate(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
LayoutChild getLayoutChild(Widget child)

Retrieves a GtkLayoutChild instance for the GtkLayoutManager, creating one if necessary.

getRequestMode
GtkSizeRequestMode getRequestMode()

Retrieves the request mode of @manager.

getWidget
Widget getWidget()

Retrieves the GtkWidget using the given GtkLayoutManager.

layoutChanged
void layoutChanged()

Queues a resize on the GtkWidget using @manager, if any.

measure
void measure(Widget widget, GtkOrientation 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.

Meta