r3345 dsilvers - /trunk/netsurf/gtk/gtk_window.c

netsurf at semichrome.net netsurf at semichrome.net
Fri Jun 15 09:14:56 BST 2007


Author: dsilvers
Date: Fri Jun 15 09:14:55 2007
New Revision: 3345

URL: http://svn.semichrome.net?rev=3D3345&view=3Drev
Log:
Make sure the GTK frontend can get and set scroll position

Modified:
    trunk/netsurf/gtk/gtk_window.c

Modified: trunk/netsurf/gtk/gtk_window.c
URL: http://svn.semichrome.net/trunk/netsurf/gtk/gtk_window.c?rev=3D3345&r1=
=3D3344&r2=3D3345&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/netsurf/gtk/gtk_window.c (original)
+++ trunk/netsurf/gtk/gtk_window.c Fri Jun 15 09:14:55 2007
@@ -594,14 +594,28 @@
 =

 bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy)
 {
-	*sx =3D 0;
-	*sy =3D 0;
-	return true;
+        GtkAdjustment *vadj =3D gtk_viewport_get_vadjustment(g->viewport);
+        GtkAdjustment *hadj =3D gtk_viewport_get_hadjustment(g->viewport);
+        =

+        assert(vadj);
+        assert(hadj);
+        =

+        *sy =3D (int)(gtk_adjustment_get_value(vadj));
+        *sx =3D (int)(gtk_adjustment_get_value(hadj));
+	=

+        return true;
 }
 =

 void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
 {
-
+        GtkAdjustment *vadj =3D gtk_viewport_get_vadjustment(g->viewport);
+        GtkAdjustment *hadj =3D gtk_viewport_get_hadjustment(g->viewport);
+        =

+        assert(vadj);
+        assert(hadj);
+        =

+        gtk_adjustment_set_value(vadj, (double)sy);
+        gtk_adjustment_set_value(hadj, (double)sx);
 }
 =

 float gui_window_get_scale(struct gui_window *g)





More information about the netsurf-commits mailing list