Next: , Previous: ClutterBrightnessContrastEffect, Up: Top


15 ClutterBoxLayout

A layout manager arranging children on a single line

15.1 Overview

The <clutter-box-layout> is a <clutter-layout-manager> implementing the following layout policy:

all children are arranged on a single line;

the axis used is controlled by the <"vertical"> boolean property;

the order of the packing is determined by the <"pack-start"> boolean property;

each child will be allocated to its natural size or, if set to expand, the available size;

if a child is set to fill on either (or both) axis, its allocation will match all the available size; the fill layout property only makes sense if the expand property is also set;

if a child is set to expand but not to fill then it is possible to control the alignment using the X and Y alignment layout properties.

if the <"homogeneous"> boolean property is set, then all widgets will get the same size, ignoring expand settings and the preferred sizes

(The missing figure, box-layout

The image shows a <clutter-box-layout> with the <"vertical"> property set to ‘#f’.

It is possible to control the spacing between children of a <clutter-box-layout> by using clutter-box-layout-set-spacing.

In order to set the layout properties when packing an actor inside a <clutter-box-layout> you should use the clutter-box-layout-pack function.

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

15.2 Usage

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

Creates a new <clutter-box-layout> layout manager

ret
the newly created <clutter-box-layout>

Since 1.2

— Function: clutter-box-layout-set-pack-start (self <clutter-box-layout>) (pack_start bool)
— Method: set-pack-start

Sets whether children of layout should be layed out by appending them or by prepending them

layout
a <clutter-box-layout>
pack-start
#t’ if the layout should pack children at the beginning of the layout

Since 1.2

— Function: clutter-box-layout-get-pack-start (self <clutter-box-layout>) ⇒  (ret bool)
— Method: get-pack-start

Retrieves the value set using clutter-box-layout-set-pack-start

layout
a <clutter-box-layout>
ret
#t’ if the <clutter-box-layout> should pack children at the beginning of the layout, and ‘#f’ otherwise

Since 1.2

— Function: clutter-box-layout-set-spacing (self <clutter-box-layout>) (spacing unsigned-int)
— Method: set-spacing

Sets the spacing between children of layout

layout
a <clutter-box-layout>
spacing
the spacing between children of the layout, in pixels

Since 1.2

— Function: clutter-box-layout-get-spacing (self <clutter-box-layout>) ⇒  (ret unsigned-int)
— Method: get-spacing

Retrieves the spacing set using clutter-box-layout-set-spacing

layout
a <clutter-box-layout>
ret
the spacing between children of the <clutter-box-layout>

Since 1.2

— Function: clutter-box-layout-set-vertical (self <clutter-box-layout>) (vertical bool)
— Method: set-vertical

Sets whether layout should arrange its children vertically alongside the Y axis, instead of horizontally alongside the X axis

layout
a <clutter-box-layout>
vertical
#t’ if the layout should be vertical

Since 1.2

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

Retrieves the orientation of the layout as set using the clutter-box-layout-set-vertical function

layout
a <clutter-box-layout>
ret
#t’ if the <clutter-box-layout> is arranging its children vertically, and ‘#f’ otherwise

Since 1.2

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

Sets whether the size of layout children should be homogeneous

layout
a <clutter-box-layout>
homogeneous
#t’ if the layout should be homogeneous

Since 1.4

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

Retrieves if the children sizes are allocated homogeneously.

layout
a <clutter-box-layout>
ret
#t’ if the <clutter-box-layout> is arranging its children homogeneously, and ‘#f’ otherwise

Since 1.4

— Function: clutter-box-layout-pack (self <clutter-box-layout>) (actor <clutter-actor>) (expand bool) (x_fill bool) (y_fill bool) (x_align <clutter-box-alignment>) (y_align <clutter-box-alignment>)
— Method: pack

Packs actor inside the <clutter-container> associated to layout and sets the layout properties

layout
a <clutter-box-layout>
actor
a <clutter-actor>
expand
whether the actor should expand
x-fill
whether the actor should fill horizontally
y-fill
whether the actor should fill vertically
x-align
the horizontal alignment policy for actor
y-align
the vertical alignment policy for actor

Since 1.2

— Function: clutter-box-layout-set-alignment (self <clutter-box-layout>) (actor <clutter-actor>) (x_align <clutter-box-alignment>) (y_align <clutter-box-alignment>)
— Method: set-alignment

Sets the horizontal and vertical alignment policies for actor inside layout

layout
a <clutter-box-layout>
actor
a <clutter-actor> child of layout
x-align
Horizontal alignment policy for actor
y-align
Vertical alignment policy for actor

Since 1.2

— Function: clutter-box-layout-get-alignment (self <clutter-box-layout>) (actor <clutter-actor>) ⇒  (x_align <clutter-box-alignment>) (y_align <clutter-box-alignment>)
— Method: get-alignment

Retrieves the horizontal and vertical alignment policies for actor as set using clutter-box-layout-pack or clutter-box-layout-set-alignment

layout
a <clutter-box-layout>
actor
a <clutter-actor> child of layout
x-align
return location for the horizontal alignment policy.
y-align
return location for the vertical alignment policy.

Since 1.2

— Function: clutter-box-layout-set-expand (self <clutter-box-layout>) (actor <clutter-actor>) (expand bool)
— Method: set-expand

Sets whether actor should expand inside layout

layout
a <clutter-box-layout>
actor
a <clutter-actor> child of layout
expand
whether actor should expand

Since 1.2

— Function: clutter-box-layout-get-expand (self <clutter-box-layout>) (actor <clutter-actor>) ⇒  (ret bool)
— Method: get-expand

Retrieves whether actor should expand inside layout

layout
a <clutter-box-layout>
actor
a <clutter-actor> child of layout
ret
#t’ if the <clutter-actor> should expand, ‘#f’ otherwise

Since 1.2

— Function: clutter-box-layout-set-fill (self <clutter-box-layout>) (actor <clutter-actor>) (x_fill bool) (y_fill bool)
— Method: set-fill

Sets the horizontal and vertical fill policies for actor inside layout

layout
a <clutter-box-layout>
actor
a <clutter-actor> child of layout
x-fill
whether actor should fill horizontally the allocated space
y-fill
whether actor should fill vertically the allocated space

Since 1.2

— Function: clutter-box-layout-get-fill (self <clutter-box-layout>) (actor <clutter-actor>) ⇒  (x_fill bool) (y_fill bool)
— Method: get-fill

Retrieves the horizontal and vertical fill policies for actor as set using clutter-box-layout-pack or clutter-box-layout-set-fill

layout
a <clutter-box-layout>
actor
a <clutter-actor> child of layout
x-fill
return location for the horizontal fill policy.
y-fill
return location for the vertical fill policy.

Since 1.2

— Function: clutter-box-layout-set-easing-mode (self <clutter-box-layout>) (mode unsigned-long)
— Method: set-easing-mode

Sets the easing mode to be used by layout when animating changes in layout properties

Use clutter-box-layout-set-use-animations to enable and disable the animations

layout
a <clutter-box-layout>
mode
an easing mode, either from <clutter-animation-mode> or a logical id from clutter-alpha-register-func

Since 1.2

— Function: clutter-box-layout-get-easing-mode (self <clutter-box-layout>) ⇒  (ret unsigned-long)
— Method: get-easing-mode

Retrieves the easing mode set using clutter-box-layout-set-easing-mode

layout
a <clutter-box-layout>
ret
an easing mode

Since 1.2