Re: Get current canvas position





On Mon, Oct 13, 2008 at 10:21 AM, Till Harbaum / Lists <lists harbaum org> wrote:
Hi,

Am Montag 13 Oktober 2008 schrieb Till Harbaum / Lists:
> Which private variables are you referring to? I only see the gtkadjustments
> which return values that don't seem to be directly related to the scroll

I have to correct myself. The gtkadjustemts _do_ relate directly to the
scroll offset. This might be what the initial post in this thread was asking for.
This:

 GtkAdjustment *hadj = ((struct _GooCanvas*)map->canvas)->hadjustment;
 GtkAdjustment *vadj = ((struct _GooCanvas*)map->canvas)->vadjustment;
 gdouble hs, vs;
 hs = gtk_adjustment_get_value(hadj);
 vs = gtk_adjustment_get_value(vadj);
 goo_canvas_convert_from_pixels(GOO_CANVAS(map->canvas), &hs, &vs);

seems to return the current scroll position in hs and vs.

Till
_______________________________________________
Goocanvas-list mailing list
Goocanvas-list gnome org
http://mail.gnome.org/mailman/listinfo/goocanvas-list

Even better, for a Python-working solution, you can create your own GtkAdjustments and call gtk.Widget.set_scroll_adjustments, then use
goocanvas.Canvas.convert_from_pixels.

Thanks for the help, all.

--
Jesse Weaver


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