From f979dc056ee4b707c3b74e9336978c0d566224bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 9 Apr 2003 16:44:45 +0000 Subject: [PATCH] * 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. --- src/ChangeLog | 8 ++++++++ src/gtkutil.c | 10 +++++----- src/xterm.c | 6 +++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6b03c4936c6..286338b9fb2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2003-04-09 Jan Dj,Ad(Brv + + * 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 * xfaces.c (Vface_font_rescale_alist): New variable. diff --git a/src/gtkutil.c b/src/gtkutil.c index 126cfc73cab..fee560c20b4 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -2512,25 +2512,25 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name) 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); diff --git a/src/xterm.c b/src/xterm.c index fc68c7b57d8..635fe3f28e4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4190,11 +4190,11 @@ xm_scroll_callback (widget, client_data, call_data) #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 @@ xg_scroll_callback (widget, data) 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; -- 2.39.2