Mercurial > emacs
comparison src/gtkutil.c @ 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 | 60da21fd968b |
children | f30e6f029d65 |
comparison
equal
deleted
inserted
replaced
50520:dd21432cf0e5 | 50521:3b4cda88d7ef |
---|---|
2510 gtk_widget_set_name (wscroll, scroll_bar_name); | 2510 gtk_widget_set_name (wscroll, scroll_bar_name); |
2511 gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS); | 2511 gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS); |
2512 | 2512 |
2513 scroll_id = xg_store_widget_in_map (wscroll); | 2513 scroll_id = xg_store_widget_in_map (wscroll); |
2514 | 2514 |
2515 g_signal_connect (G_OBJECT (vadj), | 2515 g_signal_connect (G_OBJECT (wscroll), |
2516 "value-changed", | 2516 "value-changed", |
2517 scroll_callback, | 2517 scroll_callback, |
2518 (gpointer)bar); | 2518 (gpointer) bar); |
2519 g_signal_connect (G_OBJECT (wscroll), | 2519 g_signal_connect (G_OBJECT (wscroll), |
2520 "destroy", | 2520 "destroy", |
2521 G_CALLBACK (xg_gtk_scroll_destroy), | 2521 G_CALLBACK (xg_gtk_scroll_destroy), |
2522 (gpointer)scroll_id); | 2522 (gpointer) scroll_id); |
2523 | 2523 |
2524 /* Connect to button press and button release to detect if any scroll bar | 2524 /* Connect to button press and button release to detect if any scroll bar |
2525 has the pointer. */ | 2525 has the pointer. */ |
2526 g_signal_connect (G_OBJECT (wscroll), | 2526 g_signal_connect (G_OBJECT (wscroll), |
2527 "button-press-event", | 2527 "button-press-event", |
2528 G_CALLBACK (scroll_bar_button_cb), | 2528 G_CALLBACK (scroll_bar_button_cb), |
2529 (gpointer)bar); | 2529 (gpointer) bar); |
2530 g_signal_connect (G_OBJECT (wscroll), | 2530 g_signal_connect (G_OBJECT (wscroll), |
2531 "button-release-event", | 2531 "button-release-event", |
2532 G_CALLBACK (scroll_bar_button_cb), | 2532 G_CALLBACK (scroll_bar_button_cb), |
2533 (gpointer)bar); | 2533 (gpointer) bar); |
2534 | 2534 |
2535 gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), | 2535 gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), |
2536 wscroll, -1, -1); | 2536 wscroll, -1, -1); |
2537 | 2537 |
2538 /* Set the cursor to an arrow. */ | 2538 /* Set the cursor to an arrow. */ |