Top |
gboolean | column-homogeneous | Read / Write |
guint | column-spacing | Read / Write |
ClutterOrientation | orientation | Read / Write |
gboolean | row-homogeneous | Read / Write |
guint | row-spacing | Read / Write |
ClutterGridLayout is a layout manager which arranges its child widgets in rows and columns. It is a very similar to ClutterTableLayout and ClutterBoxLayout, but it consistently uses ClutterActor's alignment and expansion flags instead of custom child properties.
Children are added using clutter_grid_layout_attach()
. They can span
multiple rows or columns. It is also possible to add a child next to an
existing child, using clutter_grid_layout_attach_next_to()
. The behaviour of
ClutterGridLayout when several children occupy the same grid cell is undefined.
ClutterGridLayout can be used like a ClutterBoxLayout by just using
clutter_actor_add_child()
, which will place children next to each other in
the direction determined by the “orientation” property.
ClutterLayoutManager *
clutter_grid_layout_new (void
);
Creates a new ClutterGridLayout
void clutter_grid_layout_attach (ClutterGridLayout *layout
,ClutterActor *child
,gint left
,gint top
,gint width
,gint height
);
Adds a widget to the grid.
The position of child
is determined by left
and top
. The
number of 'cells' that child
will occupy is determined by
width
and height
.
layout |
||
child |
the ClutterActor to add |
|
left |
the column number to attach the left side of |
|
top |
the row number to attach the top side of |
|
width |
the number of columns that |
|
height |
the number of rows that |
Since: 1.12
void clutter_grid_layout_attach_next_to (ClutterGridLayout *layout
,ClutterActor *child
,ClutterActor *sibling
,ClutterGridPosition side
,gint width
,gint height
);
Adds a actor to the grid.
The actor is placed next to sibling
, on the side determined by
side
. When sibling
is NULL
, the actor 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
== CLUTTER_GRID_POSITION_LEFT
yields a layout of 3[1].
layout |
||
child |
the actor to add |
|
sibling |
the child of |
[allow-none] |
side |
the side of |
|
width |
the number of columns that |
|
height |
the number of rows that |
Since: 1.12
ClutterActor * clutter_grid_layout_get_child_at (ClutterGridLayout *layout
,gint left
,gint top
);
Gets the child of layout
whose area covers the grid
cell whose upper left corner is at left
, top
.
Since: 1.12
void clutter_grid_layout_insert_column (ClutterGridLayout *layout
,gint 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.
Since: 1.12
void clutter_grid_layout_insert_row (ClutterGridLayout *layout
,gint 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.
Since: 1.12
void clutter_grid_layout_insert_next_to (ClutterGridLayout *layout
,ClutterActor *sibling
,ClutterGridPosition 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 CLUTTER_GRID_POSITION_LEFT
or
CLUTTER_GRID_POSITION_BOTTOM
, a row is inserted. If side
is
CLUTTER_GRID_POSITION_LEFT
of CLUTTER_GRID_POSITION_RIGHT
,
a column is inserted.
layout |
||
sibling |
the child of |
|
side |
the side of |
Since: 1.12
void clutter_grid_layout_set_orientation (ClutterGridLayout *layout
,ClutterOrientation orientation
);
Sets the orientation of the layout
Since: 1.12
ClutterOrientation
clutter_grid_layout_get_orientation (ClutterGridLayout *layout
);
Retrieves the orientation of the layout
.
Since: 1.12
void clutter_grid_layout_set_column_homogeneous (ClutterGridLayout *layout
,gboolean homogeneous
);
Sets whether all columns of layout
will have the same width.
Since: 1.12
gboolean
clutter_grid_layout_get_column_homogeneous
(ClutterGridLayout *layout
);
Returns whether all columns of layout
have the same width.
void clutter_grid_layout_set_row_homogeneous (ClutterGridLayout *layout
,gboolean homogeneous
);
Sets whether all rows of layout
will have the same height.
Since: 1.12
gboolean
clutter_grid_layout_get_row_homogeneous
(ClutterGridLayout *layout
);
Returns whether all rows of layout
have the same height.
Since: 1.12
void clutter_grid_layout_set_column_spacing (ClutterGridLayout *layout
,guint spacing
);
Sets the spacing between columns of layout
Since: 1.12
guint
clutter_grid_layout_get_column_spacing
(ClutterGridLayout *layout
);
Retrieves the spacing set using clutter_grid_layout_set_column_spacing()
Since: 1.12
void clutter_grid_layout_set_row_spacing (ClutterGridLayout *layout
,guint spacing
);
Sets the spacing between rows of layout
Since: 1.12
guint
clutter_grid_layout_get_row_spacing (ClutterGridLayout *layout
);
Retrieves the spacing set using clutter_grid_layout_set_row_spacing()
Since: 1.12
struct ClutterGridLayout;
The ClutterGridLayout structure contains only private data and should be accessed using the provided API
Since: 1.12
struct ClutterGridLayoutClass { };
The ClutterGridLayoutClass structure contains only private data and should be accessed using the provided API
Since: 1.12
“column-homogeneous”
property “column-homogeneous” gboolean
Whether all columns of the layout should have the same width
Flags: Read / Write
Default value: FALSE
Since: 1.12
“column-spacing”
property “column-spacing” guint
The amount of space in pixels between two consecutive columns
Flags: Read / Write
Default value: 0
Since: 1.12
“orientation”
property“orientation” ClutterOrientation
The orientation of the layout, either horizontal or vertical
Flags: Read / Write
Default value: CLUTTER_ORIENTATION_HORIZONTAL
Since: 1.12
“row-homogeneous”
property “row-homogeneous” gboolean
Whether all rows of the layout should have the same height
Flags: Read / Write
Default value: FALSE
Since: 1.12
“row-spacing”
property “row-spacing” guint
The amount of space in pixels between two consecutive rows
Flags: Read / Write
Default value: 0
Since: 1.12