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 611825 - Gtk.SpinButton is still editable if IsEditable=false , or doesn't allow ReadOnly mode
Gtk.SpinButton is still editable if IsEditable=false , or doesn't allow ReadO...
Status: RESOLVED DUPLICATE of bug 667229
Product: gtk+
Classification: Platform
Component: Widget: GtkSpinButton
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-03-04 17:30 UTC by Andrés G. Aragoneses (IRC: knocte)
Modified: 2012-01-05 01:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andrés G. Aragoneses (IRC: knocte) 2010-03-04 17:30:34 UTC
Steps to reproduce:
1. Create a SpinButtonEntry.
2. Set its Editable property to false.
3. Try to use the button to raise the number.

Current results:
You cannot edit the text entry but raising the number works.

Expected results:
If it's not editable, it means read-only, so it cannot be modified (don't confuse it with Sensitive=false, because this way you cannot select text to copy it to the clipboard).

Anyway, if the expected results are not accepted, the bug is not having a ReadOnly mode for this widget (enhancement then, I know).
Comment 1 Matthias Clasen 2010-03-08 17:45:46 UTC
I do think that !sensitive is what you want. Making the buttons inoperable without visual indication (ie the graying out that !sensitive gives you) would just be wrong.
Comment 2 Andrés G. Aragoneses (IRC: knocte) 2010-03-08 17:51:57 UTC
Thanks for your comment. See inline:

(In reply to comment #1)
> I do think that !sensitive is what you want. 

But !sensitive is usually less user-friendly and not suitable to my requirements because it doesn't allow the text to be selected, while yes with IsEditable=false.

> Making the buttons inoperable
> without visual indication (ie the graying out that !sensitive gives you) would
> just be wrong.

I know. This is why I was also planning on creating a but for GtkEntry that comments about this (having IsEditable=false should make it have a visual effect, for example a background color between the normal one and the grayed out, like it happens in other toolkits). So if I propose a patch for this, I'd propose the same background-color changing behavior.
Comment 3 Andrés G. Aragoneses (IRC: knocte) 2010-03-08 17:53:13 UTC
BTW, AFAIK there's no usecase for a SpinButton which is not editable by the keyboard but yes with the mouse.
Comment 4 Matthias Clasen 2010-03-09 05:19:32 UTC
even if you make the spin button noneditable, you can still change the value with the keyboard, using arrow keys. If you really want to prevent the user from changing the value without making the spinbutton insensitive, you will have to temporarily set an adjustment with min == max on the spinbutton.
Comment 5 Zeeshan Ali 2012-01-05 01:13:31 UTC

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