![]() |
![]() |
![]() |
Clutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
struct ClutterClickAction; struct ClutterClickActionClass; ClutterAction * clutter_click_action_new (void
); guint clutter_click_action_get_button (ClutterClickAction *action
); void clutter_click_action_release (ClutterClickAction *action
);
GObject +----GInitiallyUnowned +----ClutterActorMeta +----ClutterAction +----ClutterClickAction
ClutterClickAction is a sub-class of ClutterAction that implements the logic for clickable actors, by using the low level events of ClutterActor, such as "button-press-event" and "button-release-event", to synthesize the high level "clicked" signal.
To use ClutterClickAction you just need to apply it to a ClutterActor
using clutter_actor_add_action()
and connect to the
"clicked" signal:
1 2 3 4 5 |
ClutterAction *action = clutter_click_action_new (); clutter_actor_add_action (actor, action); g_signal_connect (action, "clicked", G_CALLBACK (on_clicked), NULL); |
ClutterClickAction is available since Clutter 1.4
struct ClutterClickAction;
The ClutterClickAction structure contains only private data and should be accessed using the provided API
Since 1.4
struct ClutterClickActionClass { void (* clicked) (ClutterClickAction *action, ClutterActor *actor); };
The ClutterClickActionClass structure contains only private data
class handler for the "clicked" signal |
Since 1.4
ClutterAction * clutter_click_action_new (void
);
Creates a new ClutterClickAction instance
Returns : |
the newly created ClutterClickAction |
Since 1.4
guint clutter_click_action_get_button (ClutterClickAction *action
);
Retrieves the button that was pressed.
|
a ClutterClickAction |
Returns : |
the button value |
Since 1.4
void clutter_click_action_release (ClutterClickAction *action
);
Emulates a release of the pointer button, which ungrabs the pointer and unsets the "pressed" state.
This function is useful to break a grab, for instance after a certain amount of time has passed.
|
a ClutterClickAction |
Since 1.4
"held"
property "held" gboolean : Read
Whether the clickable actor has the pointer grabbed
Default value: FALSE
Since 1.4
"clicked"
signalvoid user_function (ClutterClickAction *action,
ClutterActor *actor,
gpointer user_data) : Run Last
The ::clicked signal is emitted when the ClutterActor to which a ClutterClickAction has been applied should respond to a pointer button press and release events
|
the ClutterClickAction that emitted the signal |
|
the ClutterActor attached to the action
|
|
user data set when the signal handler was connected. |
Since 1.4