After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 143832 - GtkSpinButton doesn't update its value in certain cases
GtkSpinButton doesn't update its value in certain cases
Status: RESOLVED DUPLICATE of bug 314926
Product: gtk+
Classification: Platform
Component: Widget: Other
2.4.x
Other Linux
: Normal normal
: Medium fix
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-06-06 22:04 UTC by Paul Pogonyshev
Modified: 2007-01-23 16:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a trivial program that allows to reproduce the bug (1.22 KB, text/plain)
2004-08-12 22:50 UTC, Paul Pogonyshev
Details

Description Paul Pogonyshev 2004-06-06 22:04:56 UTC
Create a dialog with a GtkSpinButton and an "OK" button.  Change the 
spin-button value from keyboard (i.e. by typing new value in, not by clicking 
on the arrows) and activate the OK button by pressing Alt+O or Enter (not by 
mouse or by tabbing to it and pressing space).  The spin-button's adjustment's 
value is not updated.  If you deviate from using the keyboard, it is updated. 
 
I'm not sure it is a bug, but then I don't know what to do with my program so 
that the new value always gets noticed.  Please let me know if I should fix my 
program instead.
Comment 1 Paul Pogonyshev 2004-08-12 22:50:12 UTC
Created attachment 30493 [details]
a trivial program that allows to reproduce the bug

OK, I bumped into this very same bug in another program (Inkscape).  This time
I come with a program to reproduce it.
Comment 2 Owen Taylor 2004-08-13 13:52:42 UTC
In these cases, the app has to call gtk_spin_button_update() - there really
isn't much GTK+ can do about it automatically.

See related bug 106574 (more fixable), bug 50276 (validation), bug 62948 
(input methods)
Comment 3 Paul Pogonyshev 2004-08-13 14:56:34 UTC
Can't GTK+ send for instance a "focus-out-event" to whatever currently has 
focus when activating something with a keyboard?  It doesn't need to actually 
transfer the focus, only make sure that the focused widget thinks it loses 
focus. 
 
Browsing through the bugs you mentioned suggest that this problem is more 
generic than just spin-button related.  From my point of view, such behaviour 
is extremely non-obvious to a user and cannot be justified in usability terms. 
 
Comment 4 David Hoover 2006-03-07 00:05:57 UTC
I just wanted to ping this bug because I just ran into it myself (and wrote pretty much the same test program before looking to see if someone had filed it already)

In my particular case, I can hack around this, since on my OK button press I have some known code so I can tickle the currently focused field, but if you were to do something simple-minded like use gtk_dialog_run(), that's a bit trickier.

It seems really strange that by hitting control-O, I actually see the ok button depress, yet my spinbutton never sees a focus change. I guess it's a little more complicated since a callback on the spinbutton might disable the OK button/change its behavior/something.

It's not completely straight-forward, but it does seem like gtk could hopefully do something.
Comment 5 Paul Pogonyshev 2007-01-10 00:37:13 UTC
Please, either fix it or explain why suggested method is bad or won't work.
Comment 6 Xan Lopez 2007-01-23 16:30:59 UTC

*** This bug has been marked as a duplicate of 314926 ***