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 Jan Dj\e,Ad\e(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.
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);
#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;
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;