changeset 50521:3b4cda88d7ef

* xterm.c (xg_scroll_callback): Call gtk_range_get_adjustment to get GtkAdjustment as widget now is a GtkRange. * gtkutil.c (xg_create_scroll_bar): Connect to value-changed on GtkRange to avoid memory leak.
author Jan Djärv <jan.h.d@swipnet.se>
date Wed, 09 Apr 2003 16:44:45 +0000
parents dd21432cf0e5
children ac9f1c53789e
files src/ChangeLog src/gtkutil.c src/xterm.c
diffstat 3 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Apr 09 12:17:59 2003 +0000
+++ b/src/ChangeLog	Wed Apr 09 16:44:45 2003 +0000
@@ -1,3 +1,11 @@
+2003-04-09  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xterm.c (xg_scroll_callback): Call gtk_range_get_adjustment to
+	get GtkAdjustment as widget now is a GtkRange.
+
+	* gtkutil.c (xg_create_scroll_bar): Connect to value-changed on
+	GtkRange to avoid memory leak.
+
 2003-04-09  Kenichi Handa  <handa@m17n.org>
 
 	* xfaces.c (Vface_font_rescale_alist): New variable.
--- a/src/gtkutil.c	Wed Apr 09 12:17:59 2003 +0000
+++ b/src/gtkutil.c	Wed Apr 09 16:44:45 2003 +0000
@@ -2512,25 +2512,25 @@
 
   scroll_id = xg_store_widget_in_map (wscroll);
 
-  g_signal_connect (G_OBJECT (vadj),
+  g_signal_connect (G_OBJECT (wscroll),
                     "value-changed",
                     scroll_callback,
-                    (gpointer)bar);
+                    (gpointer) bar);
   g_signal_connect (G_OBJECT (wscroll),
                     "destroy",
                     G_CALLBACK (xg_gtk_scroll_destroy),
-                    (gpointer)scroll_id);
+                    (gpointer) scroll_id);
 
   /* Connect to button press and button release to detect if any scroll bar
      has the pointer.  */
   g_signal_connect (G_OBJECT (wscroll),
                     "button-press-event",
                     G_CALLBACK (scroll_bar_button_cb),
-                    (gpointer)bar);
+                    (gpointer) bar);
   g_signal_connect (G_OBJECT (wscroll),
                     "button-release-event",
                     G_CALLBACK (scroll_bar_button_cb),
-                    (gpointer)bar);
+                    (gpointer) bar);
 
   gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget),
                  wscroll, -1, -1);
--- a/src/xterm.c	Wed Apr 09 12:17:59 2003 +0000
+++ b/src/xterm.c	Wed Apr 09 16:44:45 2003 +0000
@@ -4190,11 +4190,11 @@
 #else /* !USE_MOTIF, i.e. Xaw or GTK */
 #ifdef USE_GTK
 /* Scroll bar callback for GTK scroll bars.  WIDGET is the scroll
-   bar adjustment widget.  DATA is a pointer to the scroll_bar structure. */
+   bar widget.  DATA is a pointer to the scroll_bar structure. */
 
 static void
 xg_scroll_callback (widget, data)
-     GtkWidget *widget;
+     GtkRange *widget;
      gpointer data;
 {
   struct scroll_bar *bar = (struct scroll_bar *) data;
@@ -4204,7 +4204,7 @@
   int diff;
 
   int part = -1, whole = 0, portion = 0;
-  GtkAdjustment *adj = GTK_ADJUSTMENT (widget);
+  GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (widget));
 
   if (xg_ignore_gtk_scrollbar) return;