Next: , Previous: ClutterFixedLayout, Up: Top


36 ClutterFlowLayout

A reflowing layout manager

36.1 Overview

<clutter-flow-layout> 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 ‘#f’ the actor will be allocated within that area, and if set to ‘#t’ 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 missing figure, flow-layout-image

The image shows a <clutter-flow-layout> with the <"orientation"> propert set to ‘CLUTTER_FLOW_HORIZONTAL’.

<clutter-flow-layout> is available since Clutter 1.2

36.2 Usage

— Function: clutter-flow-layout-new (orientation <clutter-flow-orientation>) ⇒  (ret <clutter-layout-manager>)

Creates a new <clutter-flow-layout> with the given orientation

orientation
the orientation of the flow layout
ret
the newly created <clutter-flow-layout>

Since 1.2

— Function: clutter-flow-layout-set-homogeneous (self <clutter-flow-layout>) (homogeneous bool)
— Method: set-homogeneous

Sets whether the layout should allocate the same space for each child

layout
a <clutter-flow-layout>
homogeneous
whether the layout should be homogeneous or not

Since 1.2

— Function: clutter-flow-layout-get-homogeneous (self <clutter-flow-layout>) ⇒  (ret bool)
— Method: get-homogeneous

Retrieves whether the layout is homogeneous

layout
a <clutter-flow-layout>
ret
#t’ if the <clutter-flow-layout> is homogeneous

Since 1.2

— Function: clutter-flow-layout-set-orientation (self <clutter-flow-layout>) (orientation <clutter-flow-orientation>)
— Method: set-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

layout
a <clutter-flow-layout>
orientation
the orientation of the layout

Since 1.2

— Function: clutter-flow-layout-set-row-spacing (self <clutter-flow-layout>) (spacing float)
— Method: set-row-spacing

Sets the spacing between rows, in pixels

layout
a <clutter-flow-layout>
spacing
the space between rows

Since 1.2

— Function: clutter-flow-layout-get-row-spacing (self <clutter-flow-layout>) ⇒  (ret float)
— Method: get-row-spacing

Retrieves the spacing between rows

layout
a <clutter-flow-layout>
ret
the spacing between rows of the <clutter-flow-layout>, in pixels

Since 1.2

— Function: clutter-flow-layout-set-row-height (self <clutter-flow-layout>) (min_height float) (max_height float)
— Method: set-row-height

Sets the minimum and maximum heights that a row can have

layout
a <clutter-flow-layout>
min-height
the minimum height of a row
max-height
the maximum height of a row

Since 1.2

— Function: clutter-flow-layout-get-row-height (self <clutter-flow-layout>) ⇒  (min_height float) (max_height float)
— Method: get-row-height

Retrieves the minimum and maximum row heights

layout
a <clutter-flow-layout>
min-height
return location for the minimum row height, or ‘#f’.
max-height
return location for the maximum row height, or ‘#f’.

Since 1.2