Re: drawing area in a scrolled window



On 6/10/07, Christopher Garrett <ctg24 admin cam ac uk> wrote:
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



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