Re: Get current canvas position



Hi,

Am Sonntag 12 Oktober 2008 schrieb Damon Chaplin:
> If you've placed the canvas in a scrolled window you can use:
>   gtk_scrolled_window_get_hadjustment()
> and then:
>   gtk_adjustment_get_value()
I am facing the same problem. At least my canvas is not inside a scrolled window and scrolling is done
via dragging (as it's done with most mapping applications).

I also face the problem to find a goocanvas replacement for gnome_canvas_get_scroll_offsets which is exactly
the function you've been asking for. I was hoping that getting the topleft position with
g_object_get(G_OBJECT(map->canvas), "x1", &sx, "y1", &sy, NULL);  would give me the current scroll
position, but that returns the upper left corner of the world and is completely unrelated to the current
scroll position.

So my solution is indeed to store the scroll position locally.

Till




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