Commit 3649e5d8 authored by Emmanuele Bassi's avatar Emmanuele Bassi

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.
parent 9f83b641
...@@ -28,10 +28,9 @@ animate_color (ClutterActor *actor, ...@@ -28,10 +28,9 @@ animate_color (ClutterActor *actor,
static gboolean static gboolean
on_crossing (ClutterActor *actor, on_crossing (ClutterActor *actor,
ClutterEvent *event, ClutterEvent *event)
gpointer data)
{ {
gboolean is_enter = GPOINTER_TO_UINT (data); gboolean is_enter = clutter_event_type (event) == CLUTTER_ENTER;
float zpos; float zpos;
if (is_enter) if (is_enter)
...@@ -128,10 +127,10 @@ main (int argc, char *argv[]) ...@@ -128,10 +127,10 @@ main (int argc, char *argv[])
clutter_actor_add_child (vase, flowers[1]); clutter_actor_add_child (vase, flowers[1]);
g_signal_connect (flowers[1], "enter-event", g_signal_connect (flowers[1], "enter-event",
G_CALLBACK (on_crossing), G_CALLBACK (on_crossing),
GUINT_TO_POINTER (TRUE)); NULL);
g_signal_connect (flowers[1], "leave-event", g_signal_connect (flowers[1], "leave-event",
G_CALLBACK (on_crossing), G_CALLBACK (on_crossing),
GUINT_TO_POINTER (FALSE)); NULL);
/* the third one is green */ /* the third one is green */
flowers[2] = clutter_actor_new (); flowers[2] = clutter_actor_new ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment