Next: , Previous: ClutterSwipeAction, Up: Top


65 ClutterTableLayout

A layout manager arranging children in rows and columns

65.1 Overview

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

children are arranged in a table

each child specifies the specific row and column cell to appear;

a child can also set a span, and this way, take more than one cell both horizontally and vertically;

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 horizontal and vertical alignment layout properties.

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

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

A <clutter-table-layout> can use animations to transition between different values of the layout management properties; the easing mode and duration used for the animations are controlled by the <"easing-mode"> and <"easing-duration"> properties and their accessor functions.

(The missing figure, table-layout-image

The image shows a <clutter-table-layout>.

<clutter-table-layout> is available since Clutter 1.4

65.2 Usage

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

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

ret
the newly created <clutter-table-layout>

Since 1.4

— Function: clutter-table-layout-get-row-count (self <clutter-table-layout>) ⇒  (ret int)
— Method: get-row-count

Retrieve the current number rows in the layout

layout
A <clutter-table-layout>
ret
the number of rows

Since 1.4

— Function: clutter-table-layout-pack (self <clutter-table-layout>) (actor <clutter-actor>) (column int) (row int)
— Method: pack

Packs actor inside the <clutter-container> associated to layout at the given row and column.

layout
a <clutter-table-layout>
actor
a <clutter-actor>
column
the column the actor should be put, or -1 to append
row
the row the actor should be put, or -1 to append

Since 1.4

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

Sets the horizontal and vertical alignment policies for actor inside layout

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

Since 1.4

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

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

layout
a <clutter-table-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.4

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

Sets the horizontal and vertical expand policies for actor inside layout

layout
a <clutter-table-layout>
actor
a <clutter-actor> child of layout
x-expand
whether actor should allocate extra space horizontally
y-expand
whether actor should allocate extra space vertically

Since 1.4

— Function: clutter-table-layout-get-expand (self <clutter-table-layout>) (actor <clutter-actor>) ⇒  (x_expand bool) (y_expand bool)
— Method: get-expand

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

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

Since 1.4

— Function: clutter-table-layout-set-fill (self <clutter-table-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-table-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.4

— Function: clutter-table-layout-get-fill (self <clutter-table-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-table-layout-pack or clutter-table-layout-set-fill

layout
a <clutter-table-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.4

— Function: clutter-table-layout-get-span (self <clutter-table-layout>) (actor <clutter-actor>) ⇒  (column_span int) (row_span int)
— Method: get-span

Retrieves the row and column span for actor as set using clutter-table-layout-pack or clutter-table-layout-set-span

layout
a <clutter-table-layout>
actor
a <clutter-actor> child of layout
column-span
return location for the col span.
row-span
return location for the row span.

Since 1.4

— Function: clutter-table-layout-set-span (self <clutter-table-layout>) (actor <clutter-actor>) (column_span int) (row_span int)
— Method: set-span

Sets the row and column span for actor inside layout

layout
a <clutter-table-layout>
actor
a <clutter-actor> child of layout
column-span
Column span for actor
row-span
Row span for actor

Since 1.4