[clutter] examples/basic: Use the event type and not a flag
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] examples/basic: Use the event type and not a flag
- Date: Mon, 30 Jul 2012 09:58:02 +0000 (UTC)
commit 3649e5d8288e9ae33b4544f8be9e3cfe14f9b5a9
Author: Emmanuele Bassi <ebassi gnome org>
Date: Sun Jul 29 13:51:23 2012 +0100
examples/basic: Use the event type and not a flag
In order to identify whether the crossing event is an enter or a leave,
we should use the ClutterEventType enumeration, not attach a value to
the signal handler.
examples/basic-actor.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/examples/basic-actor.c b/examples/basic-actor.c
index 1bfb427..e74f33e 100644
--- a/examples/basic-actor.c
+++ b/examples/basic-actor.c
@@ -28,10 +28,9 @@ animate_color (ClutterActor *actor,
static gboolean
on_crossing (ClutterActor *actor,
- ClutterEvent *event,
- gpointer data)
+ ClutterEvent *event)
{
- gboolean is_enter = GPOINTER_TO_UINT (data);
+ gboolean is_enter = clutter_event_type (event) == CLUTTER_ENTER;
float zpos;
if (is_enter)
@@ -128,10 +127,10 @@ main (int argc, char *argv[])
clutter_actor_add_child (vase, flowers[1]);
g_signal_connect (flowers[1], "enter-event",
G_CALLBACK (on_crossing),
- GUINT_TO_POINTER (TRUE));
+ NULL);
g_signal_connect (flowers[1], "leave-event",
G_CALLBACK (on_crossing),
- GUINT_TO_POINTER (FALSE));
+ NULL);
/* the third one is green */
flowers[2] = clutter_actor_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]