summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2012-07-29 13:51:23 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2012-07-30 10:54:18 +0100
commit3649e5d8288e9ae33b4544f8be9e3cfe14f9b5a9 (patch)
tree23f461bf63462289b785ce585009f9f1c00a9d26 /examples
parent9f83b64182f03025be3a785e2737ec56c1a6555c (diff)
downloadclutter-3649e5d8288e9ae33b4544f8be9e3cfe14f9b5a9.tar.gz
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.
Diffstat (limited to 'examples')
-rw-r--r--examples/basic-actor.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/basic-actor.c b/examples/basic-actor.c
index 1bfb42750..e74f33e03 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 ();