GtkGridLayout — Layout manager for grid-like widgets
GtkLayoutManager * | gtk_grid_layout_new () |
void | gtk_grid_layout_set_row_homogeneous () |
gboolean | gtk_grid_layout_get_row_homogeneous () |
void | gtk_grid_layout_set_row_spacing () |
guint | gtk_grid_layout_get_row_spacing () |
void | gtk_grid_layout_set_column_homogeneous () |
gboolean | gtk_grid_layout_get_column_homogeneous () |
void | gtk_grid_layout_set_column_spacing () |
guint | gtk_grid_layout_get_column_spacing () |
void | gtk_grid_layout_set_row_baseline_position () |
GtkBaselinePosition | gtk_grid_layout_get_row_baseline_position () |
void | gtk_grid_layout_set_baseline_row () |
int | gtk_grid_layout_get_baseline_row () |
void | gtk_grid_layout_child_set_column () |
int | gtk_grid_layout_child_get_column () |
void | gtk_grid_layout_child_set_row () |
int | gtk_grid_layout_child_get_row () |
void | gtk_grid_layout_child_set_column_span () |
int | gtk_grid_layout_child_get_column_span () |
void | gtk_grid_layout_child_set_row_span () |
int | gtk_grid_layout_child_get_row_span () |
int | baseline-row | Read / Write |
gboolean | column-homogeneous | Read / Write |
int | column-spacing | Read / Write |
gboolean | row-homogeneous | Read / Write |
int | row-spacing | Read / Write |
int | column | Read / Write |
int | column-span | Read / Write |
int | row | Read / Write |
int | row-span | Read / Write |
GObject ├── GtkLayoutChild │ ╰── GtkGridLayoutChild ╰── GtkLayoutManager ╰── GtkGridLayout
#include <gtk/gtk.h>
GtkGridLayout is a layout manager which arranges child widgets in rows and columns, with arbitrary positions and horizontal/vertical spans.
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 GtkGridLayoutChild associated to each child widget.
The behaviour of GtkGrid 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.
GtkLayoutManager *
gtk_grid_layout_new (void
);
Creates a new GtkGridLayout.
the newly created GtkGridLayout
void gtk_grid_layout_set_row_homogeneous (GtkGridLayout *grid
,gboolean homogeneous
);
Sets whether all rows of grid
should have the same height.
grid | ||
homogeneous |
|
gboolean
gtk_grid_layout_get_row_homogeneous (GtkGridLayout *grid
);
Checks whether all rows of grid
should have the same height.
grid |
TRUE
if the rows are homogeneous, and FALSE
otherwise
void gtk_grid_layout_set_row_spacing (GtkGridLayout *grid
,guint spacing
);
Sets the amount of space to insert between consecutive rows.
grid | ||
spacing | the amount of space between rows, in pixels |
guint
gtk_grid_layout_get_row_spacing (GtkGridLayout *grid
);
Retrieves the spacing set with gtk_grid_layout_set_row_spacing()
.
grid |
the spacing between consecutive rows
void gtk_grid_layout_set_column_homogeneous (GtkGridLayout *grid
,gboolean homogeneous
);
Sets whether all columns of grid
should have the same width.
grid | ||
homogeneous |
|
gboolean
gtk_grid_layout_get_column_homogeneous
(GtkGridLayout *grid
);
Checks whether all columns of grid
should have the same width.
grid |
TRUE
if the columns are homogeneous, and FALSE
otherwise
void gtk_grid_layout_set_column_spacing (GtkGridLayout *grid
,guint spacing
);
Sets the amount of space to insert between consecutive columns.
grid | ||
spacing | the amount of space between columns, in pixels |
guint
gtk_grid_layout_get_column_spacing (GtkGridLayout *grid
);
Retrieves the spacing set with gtk_grid_layout_set_column_spacing()
.
grid |
the spacing between consecutive columns
void gtk_grid_layout_set_row_baseline_position (GtkGridLayout *grid
,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.
grid | ||
row | a row index | |
pos |
GtkBaselinePosition gtk_grid_layout_get_row_baseline_position (GtkGridLayout *grid
,int row
);
Returns the baseline position of row
as set by gtk_grid_layout_set_row_baseline_position()
, or the default value of GTK_BASELINE_POSITION_CENTER
.
grid | ||
row | a row index |
the baseline position of row
void gtk_grid_layout_set_baseline_row (GtkGridLayout *grid
,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 of the grid
.
grid | ||
row | the row index |
int
gtk_grid_layout_get_baseline_row (GtkGridLayout *grid
);
Retrieves the row set with gtk_grid_layout_set_baseline_row()
.
grid |
the global baseline row
void gtk_grid_layout_child_set_column (GtkGridLayoutChild *child
,int column
);
Sets the column number to attach the left side of child
.
child | ||
column | the attach point for |
int
gtk_grid_layout_child_get_column (GtkGridLayoutChild *child
);
Retrieves the column number to which child
attaches its left side.
child |
the column number
void gtk_grid_layout_child_set_row (GtkGridLayoutChild *child
,int row
);
Sets the row to place child
in.
child | ||
row | the row for |
int
gtk_grid_layout_child_get_row (GtkGridLayoutChild *child
);
Retrieves the row number to which child
attaches its top side.
child |
the row number
void gtk_grid_layout_child_set_column_span (GtkGridLayoutChild *child
,int span
);
Sets the number of columns child
spans to.
child | ||
span | the span of |
int
gtk_grid_layout_child_get_column_span (GtkGridLayoutChild *child
);
Retrieves the number of columns that child
spans to.
child |
the number of columns
void gtk_grid_layout_child_set_row_span (GtkGridLayoutChild *child
,int span
);
Sets the number of rows child
spans to.
child | ||
span | the span of |
int
gtk_grid_layout_child_get_row_span (GtkGridLayoutChild *child
);
Retrieves the number of rows that child
spans to.
child |
the number of row
typedef struct _GtkGridLayout GtkGridLayout;
Layout manager for grid-like widgets.
typedef struct _GtkGridLayoutChild GtkGridLayoutChild;
Layout properties for children of GtkGridLayout.
“baseline-row”
property“baseline-row” int
The row to align to the baseline, when “valign” is set to GTK_ALIGN_BASELINE
.
Owner: GtkGridLayout
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“column-homogeneous”
property“column-homogeneous” gboolean
Whether all the columns in the grid have the same width.
Owner: GtkGridLayout
Flags: Read / Write
Default value: FALSE
“column-spacing”
property“column-spacing” int
The amount of space between to consecutive columns.
Owner: GtkGridLayout
Flags: Read / Write
Allowed values: [0,32767]
Default value: 0
“row-homogeneous”
property“row-homogeneous” gboolean
Whether all the rows in the grid have the same height.
Owner: GtkGridLayout
Flags: Read / Write
Default value: FALSE
“row-spacing”
property“row-spacing” int
The amount of space between to consecutive rows.
Owner: GtkGridLayout
Flags: Read / Write
Allowed values: [0,32767]
Default value: 0
“column”
property“column” int
The column to place the child in.
Owner: GtkGridLayoutChild
Flags: Read / Write
Default value: 0
“column-span”
property“column-span” int
The number of columns the child spans to.
Owner: GtkGridLayoutChild
Flags: Read / Write
Allowed values: >= 1
Default value: 1
“row”
property“row” int
The row to place the child in.
Owner: GtkGridLayoutChild
Flags: Read / Write
Default value: 0
“row-span”
property“row-span” int
The number of rows the child spans to.
Owner: GtkGridLayoutChild
Flags: Read / Write
Allowed values: >= 1
Default value: 1
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkGridLayout.html