Hi, all
I use ClutterDragAction to realize drag function, need custom "drag-motion"
signal,
the API dcument said:
The default handler of the signal will call clutter_actor_move_by() either on
actor or, if set, of "drag-handle" using the delta_x and delta_y components of
the dragging motion. If you want to override the default behaviour, you can
connect to this signal and call g_signal_stop_emission_by_name() from within
your callback.
but i conect to this signal , can not mask default handler signal , the signal
will still call clutter_actor_move_by() ?
The code is wrong?
thks!
ex.
static void
on_motion(ClutterDragAction *action,
ClutterActor *actor,
gfloat delta_x,
gfloat delta_y,
gpointer user_data)
{
dbg("on_motion: %f %f \n", delta_x, delta_y);
g_signal_stop_emission_by_name(actor, "drag-motion");
}
ClutterAction *action_move;
action_move = clutter_drag_action_new ();
clutter_drag_action_set_drag_axis(CLUTTER_DRAG_ACTION(action_move),
CLUTTER_DRAG_X_AXIS); //设定为X轴拖动
clutter_drag_action_set_drag_threshold(CLUTTER_DRAG_ACTION(action_move), 0, 0);
clutter_drag_action_set_drag_handle(CLUTTER_DRAG_ACTION(action_move),
dragBarMove);
g_signal_connect (action_move, "drag-motion", G_CALLBACK (on_motion), NULL);
clutter_actor_add_action(dragBarMove, action_move);
_______________________________________________
clutter-app-devel-list mailing list
clutter-app-devel-list@clutter-project.org
http://lists.clutter-project.org/listinfo/clutter-app-devel-list