diff options
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/gtkviewpanel.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gtkext/gtkviewpanel.c b/src/gtkext/gtkviewpanel.c index 3c9ef6b..a3bf747 100644 --- a/src/gtkext/gtkviewpanel.c +++ b/src/gtkext/gtkviewpanel.c @@ -125,14 +125,23 @@ static void gtk_view_panel_init(GtkViewPanel *panel) static void gtk_view_panel_set_scroll_adjustments(GtkViewPanel *panel, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment) { + /* TODO : déconnecter les anciens ? */ + panel->hadjustment = hadjustment; panel->vadjustment = vadjustment; - g_signal_connect(hadjustment, "value_changed", - G_CALLBACK(gtk_view_panel_adj_value_changed), panel); + /** + * On vérifie que le support n'est pas en train de nous libérer, + * avant de se connecter... + */ + + if (hadjustment != NULL) + g_signal_connect(hadjustment, "value_changed", + G_CALLBACK(gtk_view_panel_adj_value_changed), panel); - g_signal_connect(vadjustment, "value_changed", - G_CALLBACK(gtk_view_panel_adj_value_changed), panel); + if (vadjustment != NULL) + g_signal_connect(vadjustment, "value_changed", + G_CALLBACK(gtk_view_panel_adj_value_changed), panel); } |