[pygtk] click on image

Pascal DUCHATELLE pduchatelle at yahoo.fr
Tue Oct 31 22:20:29 WST 2006


Hello,

I wish to be able to get the coordinates of the point on which I click in an image (actually pdf plots converted to png format).
First : Is that possible ?
Second : I created a window in which I put a scrolledwindow in which I put a frame in which I put an image. I connect this image with the "button_press_event" and a callback in which I simply ask to print event.x and event.y.
the callback looks like this :
def callback (self, event):
    if event_button == 1:
        print "x", event.x,  "y", event.y

well it does not work.
what did I miss ? Is there any precaution to be taken with the connect ?
Thank you for your help.
Pascal

 		
---------------------------------
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20061031/dfa13ea0/attachment.htm


More information about the pygtk mailing list