Clutter.ClickAction

g Clutter.Action Clutter.Action Clutter.ClickAction Clutter.ClickAction Clutter.Action->Clutter.ClickAction Clutter.ActorMeta Clutter.ActorMeta Clutter.ActorMeta->Clutter.Action GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Clutter.ActorMeta GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

None

Methods

Inherited:

Clutter.ActorMeta (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_button ()

get_coords ()

get_state ()

release ()

Virtual Methods

Inherited:

Clutter.ActorMeta (1), GObject.Object (7)

do_clicked (actor)

do_long_press (actor, state)

Properties

Inherited:

Clutter.ActorMeta (3)

Name

Type

Flags

Short Description

held

bool

r

Whether the clickable has a grab

long-press-duration

int

r/w

The minimum duration of a long press to recognize the gesture

long-press-threshold

int

r/w

The maximum threshold before a long press is cancelled

pressed

bool

r

Whether the clickable should be in pressed state

Signals

Inherited:

GObject.Object (1)

Name

Short Description

clicked

The ::clicked signal is emitted when the Clutter.Actor to which a Clutter.ClickAction has been applied should respond to a pointer button press and release events

long-press

The ::long-press signal is emitted during the long press gesture handling.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Clutter.Action

r

Class Details

class Clutter.ClickAction(**kwargs)
Bases:

Clutter.Action

Abstract:

No

Structure:

Clutter.ClickActionClass

The Clutter.ClickAction structure contains only private data and should be accessed using the provided API

New in version 1.4.

classmethod new()
Returns:

the newly created Clutter.ClickAction

Return type:

Clutter.Action

Creates a new Clutter.ClickAction instance

New in version 1.4.

get_button()
Returns:

the button value

Return type:

int

Retrieves the button that was pressed.

New in version 1.4.

get_coords()
Returns:

press_x:

return location for the X coordinate, or None

press_y:

return location for the Y coordinate, or None

Return type:

(press_x: float, press_y: float)

Retrieves the screen coordinates of the button press.

New in version 1.8.

get_state()
Returns:

the modifier state parameter, or 0

Return type:

Clutter.ModifierType

Retrieves the modifier state of the click action.

New in version 1.6.

release()

Emulates a release of the pointer button, which ungrabs the pointer and unsets the Clutter.ClickAction :pressed state.

This function will also cancel the long press gesture if one was initiated.

This function is useful to break a grab, for instance after a certain amount of time has passed.

New in version 1.4.

do_clicked(actor) virtual
Parameters:

actor (Clutter.Actor) –

do_long_press(actor, state) virtual
Parameters:
Return type:

bool

Signal Details

Clutter.ClickAction.signals.clicked(click_action, actor)
Signal Name:

clicked

Flags:

RUN_LAST

Parameters:

The ::clicked signal is emitted when the Clutter.Actor to which a Clutter.ClickAction has been applied should respond to a pointer button press and release events

New in version 1.4.

Clutter.ClickAction.signals.long_press(click_action, actor, state)
Signal Name:

long-press

Flags:

RUN_LAST

Parameters:
Returns:

Only the Clutter.LongPressState.QUERY state uses the returned value of the handler; other states will ignore it

Return type:

bool

The ::long-press signal is emitted during the long press gesture handling.

This signal can be emitted multiple times with different states.

The Clutter.LongPressState.QUERY state will be emitted on button presses, and its return value will determine whether the long press handling should be initiated. If the signal handlers will return True, the Clutter.LongPressState.QUERY state will be followed either by a signal emission with the Clutter.LongPressState.ACTIVATE state if the long press constraints were respected, or by a signal emission with the Clutter.LongPressState.CANCEL state if the long press was cancelled.

It is possible to forcibly cancel a long press detection using Clutter.ClickAction.release().

New in version 1.8.

Property Details

Clutter.ClickAction.props.held
Name:

held

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the clickable actor has the pointer grabbed

New in version 1.4.

Clutter.ClickAction.props.long_press_duration
Name:

long-press-duration

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

The minimum duration of a press for it to be recognized as a long press gesture, in milliseconds.

A value of -1 will make the Clutter.ClickAction use the value of the Clutter.Settings :long-press-duration property.

New in version 1.8.

Clutter.ClickAction.props.long_press_threshold
Name:

long-press-threshold

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE

The maximum allowed distance that can be covered (on both axes) before a long press gesture is cancelled, in pixels.

A value of -1 will make the Clutter.ClickAction use the value of the Clutter.Settings :dnd-drag-threshold property.

New in version 1.8.

Clutter.ClickAction.props.pressed
Name:

pressed

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the clickable actor should be in “pressed” state

New in version 1.4.