Top |
Functions
GtkWidget * | gtk_grid_new () |
void | gtk_grid_attach () |
void | gtk_grid_attach_next_to () |
void | gtk_grid_remove () |
GtkWidget * | gtk_grid_get_child_at () |
void | gtk_grid_query_child () |
void | gtk_grid_insert_row () |
void | gtk_grid_insert_column () |
void | gtk_grid_remove_row () |
void | gtk_grid_remove_column () |
void | gtk_grid_insert_next_to () |
void | gtk_grid_set_row_homogeneous () |
gboolean | gtk_grid_get_row_homogeneous () |
void | gtk_grid_set_row_spacing () |
guint | gtk_grid_get_row_spacing () |
void | gtk_grid_set_column_homogeneous () |
gboolean | gtk_grid_get_column_homogeneous () |
void | gtk_grid_set_column_spacing () |
guint | gtk_grid_get_column_spacing () |
int | gtk_grid_get_baseline_row () |
void | gtk_grid_set_baseline_row () |
GtkBaselinePosition | gtk_grid_get_row_baseline_position () |
void | gtk_grid_set_row_baseline_position () |
Properties
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 |
Implemented Interfaces
GtkGrid implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkOrientable.
Description
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_attach()
. They can span multiple
rows or columns. It is also possible to add a child next to an
existing child, using gtk_grid_attach_next_to()
. To remove a child
from the grid, use gtk_grid_remove()
. The behaviour of GtkGrid when
several children occupy the same grid cell is undefined.
Functions
gtk_grid_attach ()
void gtk_grid_attach (GtkGrid *grid
,GtkWidget *child
,int column
,int row
,int width
,int height
);
Adds a widget to the grid.
The position of child
is determined by column
and row
.
The number of “cells” that child
will occupy is determined
by width
and height
.
Parameters
grid |
a GtkGrid |
|
child |
the widget to add |
|
column |
the column number to attach the left side of |
|
row |
the row number to attach the top side of |
|
width |
the number of columns that |
|
height |
the number of rows that |
gtk_grid_attach_next_to ()
void gtk_grid_attach_next_to (GtkGrid *grid
,GtkWidget *child
,GtkWidget *sibling
,GtkPositionType side
,int width
,int height
);
Adds a widget to the grid.
The widget is placed next to sibling
, on the side determined by
side
. When sibling
is NULL
, the widget is placed in row (for
left or right placement) or column 0 (for top or bottom placement),
at the end indicated by side
.
Attaching widgets labeled [1], [2], [3] with sibling
== NULL
and
side
== GTK_POS_LEFT
yields a layout of 3[1].
Parameters
grid |
a GtkGrid |
|
child |
the widget to add |
|
sibling |
the child of |
[allow-none] |
side |
the side of |
|
width |
the number of columns that |
|
height |
the number of rows that |
gtk_grid_remove ()
void gtk_grid_remove (GtkGrid *grid
,GtkWidget *child
);
Removes a child from grid
, after it has been added
with gtk_grid_attach()
or gtk_grid_attach_next_to()
.
gtk_grid_get_child_at ()
GtkWidget * gtk_grid_get_child_at (GtkGrid *grid
,int column
,int row
);
Gets the child of grid
whose area covers the grid
cell at column
, row
.
gtk_grid_query_child ()
void gtk_grid_query_child (GtkGrid *grid
,GtkWidget *child
,int *column
,int *row
,int *width
,int *height
);
Queries the attach points and spans of child
inside the given GtkGrid.
gtk_grid_insert_row ()
void gtk_grid_insert_row (GtkGrid *grid
,int position
);
Inserts a row at the specified position.
Children which are attached at or below this position are moved one row down. Children which span across this position are grown to span the new row.
gtk_grid_insert_column ()
void gtk_grid_insert_column (GtkGrid *grid
,int position
);
Inserts a column at the specified position.
Children which are attached at or to the right of this position are moved one column to the right. Children which span across this position are grown to span the new column.
gtk_grid_remove_row ()
void gtk_grid_remove_row (GtkGrid *grid
,int position
);
Removes a row from the grid.
Children that are placed in this row are removed, spanning children that overlap this row have their height reduced by one, and children below the row are moved up.
gtk_grid_remove_column ()
void gtk_grid_remove_column (GtkGrid *grid
,int position
);
Removes a column from the grid.
Children that are placed in this column are removed, spanning children that overlap this column have their width reduced by one, and children after the column are moved to the left.
gtk_grid_insert_next_to ()
void gtk_grid_insert_next_to (GtkGrid *grid
,GtkWidget *sibling
,GtkPositionType side
);
Inserts a row or column at the specified position.
The new row or column is placed next to sibling
, on the side
determined by side
. If side
is GTK_POS_TOP
or GTK_POS_BOTTOM
,
a row is inserted. If side
is GTK_POS_LEFT
of GTK_POS_RIGHT
,
a column is inserted.
Parameters
grid |
a GtkGrid |
|
sibling |
the child of |
|
side |
the side of |
gtk_grid_set_row_homogeneous ()
void gtk_grid_set_row_homogeneous (GtkGrid *grid
,gboolean homogeneous
);
Sets whether all rows of grid
will have the same height.
gtk_grid_get_row_homogeneous ()
gboolean
gtk_grid_get_row_homogeneous (GtkGrid *grid
);
Returns whether all rows of grid
have the same height.
gtk_grid_set_row_spacing ()
void gtk_grid_set_row_spacing (GtkGrid *grid
,guint spacing
);
Sets the amount of space between rows of grid
.
gtk_grid_get_row_spacing ()
guint
gtk_grid_get_row_spacing (GtkGrid *grid
);
Returns the amount of space between the rows of grid
.
gtk_grid_set_column_homogeneous ()
void gtk_grid_set_column_homogeneous (GtkGrid *grid
,gboolean homogeneous
);
Sets whether all columns of grid
will have the same width.
gtk_grid_get_column_homogeneous ()
gboolean
gtk_grid_get_column_homogeneous (GtkGrid *grid
);
Returns whether all columns of grid
have the same width.
gtk_grid_set_column_spacing ()
void gtk_grid_set_column_spacing (GtkGrid *grid
,guint spacing
);
Sets the amount of space between columns of grid
.
gtk_grid_get_column_spacing ()
guint
gtk_grid_get_column_spacing (GtkGrid *grid
);
Returns the amount of space between the columns of grid
.
gtk_grid_get_baseline_row ()
int
gtk_grid_get_baseline_row (GtkGrid *grid
);
Returns which row defines the global baseline of grid
.
gtk_grid_set_baseline_row ()
void gtk_grid_set_baseline_row (GtkGrid *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
.
gtk_grid_get_row_baseline_position ()
GtkBaselinePosition gtk_grid_get_row_baseline_position (GtkGrid *grid
,int row
);
Returns the baseline position of row
as set
by gtk_grid_set_row_baseline_position()
or the default value
GTK_BASELINE_POSITION_CENTER
.
gtk_grid_set_row_baseline_position ()
void gtk_grid_set_row_baseline_position (GtkGrid *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.
Property Details
The “baseline-row”
property
“baseline-row” int
The row to align the to the baseline when valign is GTK_ALIGN_BASELINE.
Owner: GtkGrid
Flags: Read / Write
Allowed values: >= 0
Default value: 0
The “column-homogeneous”
property
“column-homogeneous” gboolean
If TRUE, the columns are all the same width.
Owner: GtkGrid
Flags: Read / Write
Default value: FALSE
The “column-spacing”
property
“column-spacing” int
The amount of space between two consecutive columns.
Owner: GtkGrid
Flags: Read / Write
Allowed values: [0,32767]
Default value: 0
The “row-homogeneous”
property
“row-homogeneous” gboolean
If TRUE, the rows are all the same height.
Owner: GtkGrid
Flags: Read / Write
Default value: FALSE