From ba97b1467a3e19db7c1084651463e367930c3bb9 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 27 Nov 2000 17:47:52 +0000 Subject: [PATCH] Connect to the "changed" callback of the adjustment. We need to redraw the 2000-11-27 Federico Mena Quintero * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to the "changed" callback of the adjustment. We need to redraw the spin button's arrows when the adjustment's range changes. (adjustment_changed_cb): Draw the arrows. (gtk_spin_button_value_changed): Draw the arrows. --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-0 | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gtk/gtkspinbutton.c | 20 ++++++++++++++++++++ 8 files changed, 76 insertions(+) diff --git a/ChangeLog b/ChangeLog index 174ce2b738..1dddd15bcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-11-27 Federico Mena Quintero + + * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to + the "changed" callback of the adjustment. We need to redraw the + spin button's arrows when the adjustment's range changes. + (adjustment_changed_cb): Draw the arrows. + (gtk_spin_button_value_changed): Draw the arrows. + 2000-11-23 Alexander Larsson * gdk/linux-fb/gdkselection-fb.c: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 174ce2b738..1dddd15bcd 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2000-11-27 Federico Mena Quintero + + * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to + the "changed" callback of the adjustment. We need to redraw the + spin button's arrows when the adjustment's range changes. + (adjustment_changed_cb): Draw the arrows. + (gtk_spin_button_value_changed): Draw the arrows. + 2000-11-23 Alexander Larsson * gdk/linux-fb/gdkselection-fb.c: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 174ce2b738..1dddd15bcd 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2000-11-27 Federico Mena Quintero + + * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to + the "changed" callback of the adjustment. We need to redraw the + spin button's arrows when the adjustment's range changes. + (adjustment_changed_cb): Draw the arrows. + (gtk_spin_button_value_changed): Draw the arrows. + 2000-11-23 Alexander Larsson * gdk/linux-fb/gdkselection-fb.c: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 174ce2b738..1dddd15bcd 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2000-11-27 Federico Mena Quintero + + * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to + the "changed" callback of the adjustment. We need to redraw the + spin button's arrows when the adjustment's range changes. + (adjustment_changed_cb): Draw the arrows. + (gtk_spin_button_value_changed): Draw the arrows. + 2000-11-23 Alexander Larsson * gdk/linux-fb/gdkselection-fb.c: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 174ce2b738..1dddd15bcd 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2000-11-27 Federico Mena Quintero + + * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to + the "changed" callback of the adjustment. We need to redraw the + spin button's arrows when the adjustment's range changes. + (adjustment_changed_cb): Draw the arrows. + (gtk_spin_button_value_changed): Draw the arrows. + 2000-11-23 Alexander Larsson * gdk/linux-fb/gdkselection-fb.c: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 174ce2b738..1dddd15bcd 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2000-11-27 Federico Mena Quintero + + * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to + the "changed" callback of the adjustment. We need to redraw the + spin button's arrows when the adjustment's range changes. + (adjustment_changed_cb): Draw the arrows. + (gtk_spin_button_value_changed): Draw the arrows. + 2000-11-23 Alexander Larsson * gdk/linux-fb/gdkselection-fb.c: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 174ce2b738..1dddd15bcd 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2000-11-27 Federico Mena Quintero + + * gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to + the "changed" callback of the adjustment. We need to redraw the + spin button's arrows when the adjustment's range changes. + (adjustment_changed_cb): Draw the arrows. + (gtk_spin_button_value_changed): Draw the arrows. + 2000-11-23 Alexander Larsson * gdk/linux-fb/gdkselection-fb.c: diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index b5a55a8a9a..1c5a484939 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -1047,6 +1047,9 @@ gtk_spin_button_value_changed (GtkAdjustment *adjustment, &return_val); if (return_val == FALSE) gtk_spin_button_default_output (spin_button); + + gtk_spin_button_draw_arrow (spin_button, GTK_ARROW_UP); + gtk_spin_button_draw_arrow (spin_button, GTK_ARROW_DOWN); } static gint @@ -1404,6 +1407,20 @@ gtk_spin_button_new (GtkAdjustment *adjustment, return GTK_WIDGET (spin); } +/* Callback used when the spin button's adjustment changes. We need to redraw + * the arrows when the adjustment's range changes. + */ +static void +adjustment_changed_cb (GtkAdjustment *adjustment, gpointer data) +{ + GtkSpinButton *spin_button; + + spin_button = GTK_SPIN_BUTTON (data); + + gtk_spin_button_draw_arrow (spin_button, GTK_ARROW_UP); + gtk_spin_button_draw_arrow (spin_button, GTK_ARROW_DOWN); +} + void gtk_spin_button_set_adjustment (GtkSpinButton *spin_button, GtkAdjustment *adjustment) @@ -1426,6 +1443,9 @@ gtk_spin_button_set_adjustment (GtkSpinButton *spin_button, gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", (GtkSignalFunc) gtk_spin_button_value_changed, (gpointer) spin_button); + gtk_signal_connect (GTK_OBJECT (adjustment), "changed", + (GtkSignalFunc) adjustment_changed_cb, + (gpointer) spin_button); } } }