summaryrefslogtreecommitdiff
path: root/gtk/gtkspinbutton.c
diff options
context:
space:
mode:
authorLars Hamann <lars@gtk.org>1999-01-08 00:21:36 +0000
committerLars Hamann <lars@src.gnome.org>1999-01-08 00:21:36 +0000
commitb56693d114a9033d5d371b668ac5304a88d6effd (patch)
tree0c3b1ec20dcbb2c0ef9b323c8336a54d676d3b8d /gtk/gtkspinbutton.c
parent41604dd844dd5ad482a9703248c290ea62a58587 (diff)
downloadgdk-pixbuf-b56693d114a9033d5d371b668ac5304a88d6effd.tar.gz
call gtk_spin_button_update before returning a value
Fri Jan 8 00:42:00 1999 Lars Hamann <lars@gtk.org> * gtk/gtkspinbutton.c (gtk_spin_button_get_value_as_int) (gtk_spin_button_get_value_as_float): call gtk_spin_button_update before returning a value * gtk/gtkclist.c (gtk_clist_motion): don't allow 'drag selections' if clist is a drag source. (gtk_clist_drag_begin): remove pointer grabs, end ongoing selections. * gtk/gtkctree.c (remove_grab): copy of clist function. (gtk_ctree_drag_begin): let clists drag_begin method set the source info struct.
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r--gtk/gtkspinbutton.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 54162c5f0..7752b5578 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -1414,6 +1414,9 @@ gtk_spin_button_get_value_as_float (GtkSpinButton *spin_button)
g_return_val_if_fail (spin_button != NULL, 0.0);
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), 0.0);
+ if (GTK_EDITABLE (spin_button)->editable)
+ gtk_spin_button_update (spin_button);
+
return spin_button->adjustment->value;
}
@@ -1425,6 +1428,9 @@ gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button)
g_return_val_if_fail (spin_button != NULL, 0);
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), 0);
+ if (GTK_EDITABLE (spin_button)->editable)
+ gtk_spin_button_update (spin_button);
+
val = spin_button->adjustment->value;
if (val - floor (val) < ceil (val) - val)
return floor (val);