RE: drawing area in a scrolled window



However, I have only been able to get mouse coordinates from the drawing
area.
I would like to get coordinates from the origin in the top left of the
scrolled
window.  What do I need to do?  I tried getting coords from the alignment,
but
that seems to cover exactly the same area as the drawing area itself...

I do this in two stages: I read adj->value and adj->page_size on
"changed" and "value_changed" to get the position and size of the
viewport in the large drawing area and note it. On a mouse event, I
can subtract the viewport from the mouse x/y to get window-relative
coordinates.

John

Thanks for the tip John.  Unfortunately, I cant seem to get mouse events in the
grey area around the drawingarea - which object should I be getting
motion-events from?  I think I've tried everything but I've probably missed the
one correct approach!
 
Best regards,
 
Chris.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]