Top | ![]() |
![]() |
![]() |
![]() |
ClutterActor * | mx_grid_new () |
void | mx_grid_set_line_alignment () |
gboolean | mx_grid_get_line_alignment () |
void | mx_grid_set_homogenous_rows () |
gboolean | mx_grid_get_homogenous_rows () |
void | mx_grid_set_homogenous_columns () |
gboolean | mx_grid_get_homogenous_columns () |
void | mx_grid_set_orientation () |
MxOrientation | mx_grid_get_orientation () |
void | mx_grid_set_row_spacing () |
gfloat | mx_grid_get_row_spacing () |
void | mx_grid_set_column_spacing () |
gfloat | mx_grid_get_column_spacing () |
void | mx_grid_set_child_y_align () |
MxAlign | mx_grid_get_child_y_align () |
void | mx_grid_set_child_x_align () |
MxAlign | mx_grid_get_child_x_align () |
void | mx_grid_set_max_stride () |
gint | mx_grid_get_max_stride () |
MxGrid is a layout container that arranges its children by placing them in a single line and wrapping round to a new line when the edge of the container is reached.
This layout is particularly flexible, with the following configuration possibilities:
Column and row spacing are controllable (“column_spacing” and “row_spacing”)
Column and row sizes can be made consistent, regardless of the size of the contained actors (“homogenous_columns” and “homogenous_rows”)
Prefer to pack children vertically first, rather than horizontally (“orientation”)
Specify the maximum number of rows or columns to allow in the layout, to prevent it from being excessively stretched (“max_stride”).
To demonstrate how these settings interact, here are a few images.
Figure 5. MxGrid flowing across multiple rows
An MxGrid containing 9 child actors; “orientation” is set to the default (MX_ORIENTATION_HORIZONTAL, i.e. lay out horizontally first); “max_stride” has not been set (so there's no maximum row size); “column_spacing” and “row_spacing” have been set so that there is spacing between cells vertically and horizontally.
Figure 6. MxGrid flowing on a single row
The image shows the same MxGrid with its children flowing into one row. This is the layout's response to being resized horizontally.
Figure 7. MxGrid flowing onto two rows
The same MxGrid with 9 children wrapping onto two rows: notice how the "odd" rectangle is on the end of a row, rather than at the bottom of a column. This is because preference is being given to packing onto the end of rows, rather than columns, because “orientation” is set to MX_ORIENTATION_HORIZONTAL. Even though there is room for the rectangle at the bottom of the column, the layout prefers to place children onto the end of a row if there is room.
Figure 8. MxGrid flowing into two columns
The same MxGrid 9 children with “orientation” set to MX_ORIENTATION_VERTICAL. This time, the layout wraps onto two columns rather than two rows. Even though there is room on the end of the rows for the children, the preference is for them to be placed on the bottom of columns, or into new columns, before being added to rows.
void mx_grid_set_homogenous_columns (MxGrid *self
,gboolean value
);