so, i've done some tests on this subject, and i used glade for the interface... i made a very simple interface, with a window and a scrolledwindow with a image... but i only realized now that, when i added a image inside the scrolledwindow, glade added automaticly a viewport, so my widget tree would look something like this:
window
scrolledwindow
viewport
image
soh i connected the button press event to the viewport (added the flags too) and there you go.. problem solved... it showed to me the (x, y) position of position that i clicked on the image, even if the image was scrolled... hum, how come i never saw that before? :)
2006/11/2, Pascal DUCHATELLE <[EMAIL PROTECTED]>:
Thank you for your answers. It is just what I needed too.
Pascal
Rodrigo Renie Braga < [EMAIL PROTECTED]> a écrit :humm, very nice... just what i needed... i'll test it and post it back... thanks!have." John Carmack _______________________________________________2006/11/1, David Keogh <[EMAIL PROTECTED]>:On 10/31/06, Rodrigo Renie Braga <[EMAIL PROTECTED] > 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 [email protected]
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
pygtk mailing list [email protected]
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.
_______________________________________________
pygtk mailing list [email protected]
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 [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
