I was wondering whether it is possible to attach the mouse click signal to a cairo object. Let us suppose I have 3 circles on a drawing, all separate objects. I would then like to change the colour of the ones on which I click. I guess, I could just take the coordinates of the mouse pointer, go through all objects, and see which one is closest. It could be OK for regular objects, but might become a bit unwieldy for hand-drawn lines. So, my question is, is there an elegant way of finding out on which object the user clicked? I was thinking that one could perhaps attach the mouse signal when one draws the objects, and then just return the object name, whenever there is a mouse click. I am using pygtk, but I think the answer should not be specific to the actual language binding.
Cheers,
v923z