Top | ![]() |
![]() |
![]() |
![]() |
ClutterFlowLayout is a layout manager which implements the following policy:
the preferred natural size depends on the value of the “orientation” property; the layout will try to maintain all its children on a single row or column;
if either the width or the height allocated are smaller than the preferred ones, the layout will wrap; in this case, the preferred height or width, respectively, will take into account the amount of columns and rows;
each line (either column or row) in reflowing will
have the size of the biggest cell on that line; if the
“homogeneous” property is set to FALSE
the actor
will be allocated within that area, and if set to TRUE
instead the
actor will be given exactly that area;
the size of the columns or rows can be controlled for both minimum and maximum; the spacing can also be controlled in both columns and rows.
The flow-layout example shows how to use the ClutterFlowLayout.
ClutterFlowLayout is available since Clutter 1.2
ClutterLayoutManager *
clutter_flow_layout_new (ClutterFlowOrientation orientation
);
Creates a new ClutterFlowLayout with the given orientation
Since: 1.2
void clutter_flow_layout_set_homogeneous (ClutterFlowLayout *layout
,gboolean homogeneous
);
Sets whether the layout
should allocate the same space for
each child
Since: 1.2
gboolean
clutter_flow_layout_get_homogeneous (ClutterFlowLayout *layout
);
Retrieves whether the layout
is homogeneous
Since: 1.2
void clutter_flow_layout_set_orientation (ClutterFlowLayout *layout
,ClutterFlowOrientation orientation
);
Sets the orientation of the flow layout
The orientation controls the direction used to allocate the children: either horizontally or vertically. The orientation also controls the direction of the overflowing
Since: 1.2
ClutterFlowOrientation
clutter_flow_layout_get_orientation (ClutterFlowLayout *layout
);
Retrieves the orientation of the layout
Since: 1.2
void clutter_flow_layout_set_snap_to_grid (ClutterFlowLayout *layout
,gboolean snap_to_grid
);
Whether the layout
should place its children on a grid.
Since: 1.16
gboolean
clutter_flow_layout_get_snap_to_grid (ClutterFlowLayout *layout
);
Retrieves the value of “snap-to-grid” property
Since: 1.16
void clutter_flow_layout_set_column_spacing (ClutterFlowLayout *layout
,gfloat spacing
);
Sets the space between columns, in pixels
Since: 1.2
gfloat
clutter_flow_layout_get_column_spacing
(ClutterFlowLayout *layout
);
Retrieves the spacing between columns
Since: 1.2
void clutter_flow_layout_set_row_spacing (ClutterFlowLayout *layout
,gfloat spacing
);
Sets the spacing between rows, in pixels
Since: 1.2
gfloat
clutter_flow_layout_get_row_spacing (ClutterFlowLayout *layout
);
Retrieves the spacing between rows
Since: 1.2
void clutter_flow_layout_set_column_width (ClutterFlowLayout *layout
,gfloat min_width
,gfloat max_width
);
Sets the minimum and maximum widths that a column can have
Since: 1.2
void clutter_flow_layout_get_column_width (ClutterFlowLayout *layout
,gfloat *min_width
,gfloat *max_width
);
Retrieves the minimum and maximum column widths
layout |
||
min_width |
return location for the minimum column width, or |
[out] |
max_width |
return location for the maximum column width, or |
[out] |
Since: 1.2
void clutter_flow_layout_set_row_height (ClutterFlowLayout *layout
,gfloat min_height
,gfloat max_height
);
Sets the minimum and maximum heights that a row can have
Since: 1.2
void clutter_flow_layout_get_row_height (ClutterFlowLayout *layout
,gfloat *min_height
,gfloat *max_height
);
Retrieves the minimum and maximum row heights
layout |
||
min_height |
return location for the minimum row height, or |
[out] |
max_height |
return location for the maximum row height, or |
[out] |
Since: 1.2
The direction of the arrangement of the children inside a ClutterFlowLayout
Since: 1.2
struct ClutterFlowLayout { };
The ClutterFlowLayout structure contains only private data and should be accessed using the provided API
Since: 1.2
struct ClutterFlowLayoutClass { };
The ClutterFlowLayoutClass structure contains only private data and should be accessed using the provided API
Since: 1.2