Next: , Previous: Stage Manager, Up: Top


60 ClutterSnapConstraint

A constraint snapping two actors together

60.1 Overview

<clutter-snap-constraint> is a constraint the snaps the edges of two actors together, expanding the actor's allocation if necessary.

An offset can be applied to the constraint, to provide spacing.

<clutter-snap-constraint> is available since Clutter 1.6

60.2 Usage

— Function: clutter-snap-constraint-new (source <clutter-actor>) (from_edge <clutter-snap-edge>) (to_edge <clutter-snap-edge>) (offset float) ⇒  (ret <clutter-constraint>)

Creates a new <clutter-snap-constraint> that will snap a <clutter-actor> to the edge of source, with the given offset.

source
the <clutter-actor> to use as the source of the constraint, or ‘#f’.
from-edge
the edge of the actor to use in the constraint
to-edge
the edge of source to use in the constraint
offset
the offset to apply to the constraint, in pixels
ret
the newly created <clutter-snap-constraint>

Since 1.6

— Function: clutter-snap-constraint-set-source (self <clutter-snap-constraint>) (source <clutter-actor>)
— Method: set-source

Sets the source <clutter-actor> for the constraint

constraint
a <clutter-snap-constraint>
source
a <clutter-actor>, or ‘#f’ to unset the source.

Since 1.6

— Function: clutter-snap-constraint-get-source (self <clutter-snap-constraint>) ⇒  (ret <clutter-actor>)
— Method: get-source

Retrieves the <clutter-actor> set using clutter-snap-constraint-set-source

constraint
a <clutter-snap-constraint>
ret
a pointer to the source actor.

Since 1.6

— Function: clutter-snap-constraint-set-edges (self <clutter-snap-constraint>) (from_edge <clutter-snap-edge>) (to_edge <clutter-snap-edge>)
— Method: set-edges

Sets the edges to be used by the constraint

The from-edge is the edge on the <clutter-actor> to which constraint has been added. The to-edge is the edge of the <clutter-actor> inside the <"source"> property.

constraint
a <clutter-snap-constraint>
from-edge
the edge on the actor
to-edge
the edge on the source

Since 1.6

— Function: clutter-snap-constraint-get-edges (self <clutter-snap-constraint>) ⇒  (from_edge <clutter-snap-edge>) (to_edge <clutter-snap-edge>)
— Method: get-edges

Retrieves the edges used by the constraint

constraint
a <clutter-snap-constraint>
from-edge
return location for the actor's edge, or ‘#f’.
to-edge
return location for the source's edge, or ‘#f’.

Since 1.6

— Function: clutter-snap-constraint-set-offset (self <clutter-snap-constraint>) (offset float)
— Method: set-offset

Sets the offset to be applied to the constraint

constraint
a <clutter-snap-constraint>
offset
the offset to apply, in pixels

Since 1.6

— Function: clutter-snap-constraint-get-offset (self <clutter-snap-constraint>) ⇒  (ret float)
— Method: get-offset

Retrieves the offset set using clutter-snap-constraint-set-offset

constraint
a <clutter-snap-constraint>
ret
the offset, in pixels

Since 1.6