summaryrefslogtreecommitdiff
path: root/gtk/gtkspinbutton.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-01-23 20:15:48 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-01-23 20:15:48 +0000
commitc099271bb5b6b6366514977393244e1fa496b534 (patch)
tree644f659544d85d42637849f247a511683c28b99f /gtk/gtkspinbutton.c
parent44d727eaa1dca1990a53840c90603683237338e8 (diff)
downloadgtk+-c099271bb5b6b6366514977393244e1fa496b534.tar.gz
Stop spinning if widget becomes insensitive. (#56248)
Wed Jan 23 15:12:16 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkspinbutton.c (gtk_spin_button_state_changed): Stop spinning if widget becomes insensitive. (#56248)
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r--gtk/gtkspinbutton.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index ad99dd4d85..12b3ac22b2 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -105,6 +105,8 @@ static gint gtk_spin_button_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static void gtk_spin_button_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
+static void gtk_spin_button_state_changed (GtkWidget *widget,
+ GtkStateType previous_state);
static void gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
guint arrow);
static gint gtk_spin_button_timer (GtkSpinButton *spin_button);
@@ -209,6 +211,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
widget_class->leave_notify_event = gtk_spin_button_leave_notify;
widget_class->focus_out_event = gtk_spin_button_focus_out;
widget_class->grab_notify = gtk_spin_button_grab_notify;
+ widget_class->state_changed = gtk_spin_button_state_changed;
entry_class->activate = gtk_spin_button_activate;
@@ -914,6 +917,14 @@ gtk_spin_button_grab_notify (GtkWidget *widget,
gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (widget));
}
+static void
+gtk_spin_button_state_changed (GtkWidget *widget,
+ GtkStateType previous_state)
+{
+ if (!GTK_WIDGET_IS_SENSITIVE (widget))
+ gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (widget));
+}
+
static gint
gtk_spin_button_scroll (GtkWidget *widget,
GdkEventScroll *event)