[pygtk] click on image

Pascal DUCHATELLE pduchatelle at yahoo.fr
Thu Nov 2 22:57:19 WST 2006


Thank you for your answers. It is just what I needed too.

Pascal

Rodrigo Renie Braga <rodrigorenie at gmail.com> a écrit : humm, very nice... just what i needed... i'll test it and post it back... thanks!

2006/11/1, David Keogh <davekeogh at shaw.ca>: On 10/31/06, Rodrigo Renie Braga <rodrigorenie at gmail.com > wrote: yeah, i tried to do that once, and it works at first, but the problem is when the windows is scrolled.. the coordinates won't change, for example, the upper left corner will always be (0, 0), no matter if the image was scrolled or not... so i didn't find a way to know the position of a click on an image... not in a scrolled window anyway... 


You can do something like this:

hadj = scrolled_window.get_hadjustment() 
vadj = scrolled_window.get_vadjustment()

hoffset = hadj.get_value()
voffset = vadj.get_value()

You can add those values to your coordinates, to get the coordinates on the image itself.
 
David
  
_______________________________________________
pygtk mailing list   pygtk at daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ 






-- 

"The best way to sell yourself is to show what you have produced, rather
than tell people what you know, what you want to do, or what degrees you 
have." John Carmack _______________________________________________
pygtk mailing list   pygtk at daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


 		
---------------------------------
 Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20061102/0f327222/attachment.htm


More information about the pygtk mailing list