Hi,

On Mon, 2007-10-22 at 17:54 +0300, Karoliina Salminen wrote:
> Hello,
> 
> void
> on_input (ClutterStage *stage,
>       ClutterEvent *event,
>       gpointer      user_data)
> {
>   if (event->type == CLUTTER_BUTTON_PRESS)
>   {
>     gint                x, y;
>     ClutterActor       *clickeditem;
>     clutter_event_get_coords (event, &x, &y);
>     clickeditem = clutter_stage_get_actor_at_pos (stage, x, y);
>     if(!clickeditem){
>         printf("Stage clicked, not reached any item, x=%d, y=%d\n", x, y);
>     } else {
>         printf("Some item got\n");
>     }
>     if(clickeditem==g_buttons[0]->actor){
>         printf("Button0 clicked!!");
>     }
> 
> 
>   }

The actor you are receiving is probably an actor within the group. You
would need to do something like this to find what has been clicked:

ClutterActor *clicked;
gboolean res = FALSE;

clicked = clutter_stage_get_actor_at_pos (stage, x, y);
while (!CLUTTER_IS_STAGE (clicked))
{
        if (clicked == g_buttons[0]->actor)
        {
                res = TRUE;
                break;
        }
        clicked = clutter_actor_get_parent (clicked);
}

> Would there be some way to check actor type like on Gtk etc. or maybe
> print out some information about the item I am getting?
> 

Not sure, have you tried clutter_actor_get_id () or
clutter_actor_get_name (). 

Regards,

Neil

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to