GNOME Bugzilla – Bug 106574
Inconsistent increment behavior for gtkspinbutton
Last modified: 2008-05-27 22:51:09 UTC
Create a spinbutton Click to focus the entry area Erase and replace the number with a new number substantially different (call it N) Click on the 'up' arrow control for the widget, the value with goto N+<step> Now enter another substantially different number (call it P) Hit the 'up-arrow' on the keyboard. You will goto N+2*<step>, not P+<step> NOTE - do not hit '<return>' after enter the numbers in the above instructions
I think this actually behaves as intended, since the text entered with the keyboard doesn't actually change the value of the spinbutton until you hit return. This is a bit confusing, because the entry somehow doubles as both a n observer of the spinbutton value (when using the mouse) and as an input buffer to assemble the value to change to upon hitting return. Maybe the behaviour could be improved by making the buttons commit the entry text before doing the increment.
Commit before changing values makes sense to me.
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as Matthias said he was trying to do himself on IRC and was asking for help with. If you see this message, it means I was successful at fixing the borken-ness in bugzilla :) Sorry for the spam; just query on this message and delete all emails you get with this message, since there will probably be a lot.
*** Bug 157781 has been marked as a duplicate of this bug. ***
Created attachment 111126 [details] [review] Commit value before keyboard scrolling it Patch that fixes the problem like you suggested it. Here is the test case: adj = gtk.Adjustment(1, 0, 100, 1, 10, 10) spin = gtk.SpinButton(adj, 1, 2) spin.set_text('5') gtk.bindings_activate(spin, gtk.keysyms.Up, 0) assert spin.get_value() == 6
Looks right to me. Please commit.
106574 - Inconsistent increment behavior for gtkspinbutton * gtk/gtkspinbutton.c (gtk_spin_button_real_value_change): Commit the entry text before doing an increment. Patch by Björn Lindqvist.