GNOME Bugzilla – Bug 611825
Gtk.SpinButton is still editable if IsEditable=false , or doesn't allow ReadOnly mode
Last modified: 2012-01-05 01:13:31 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).
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.
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.
BTW, AFAIK there's no usecase for a SpinButton which is not editable by the keyboard but yes with the mouse.
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.
*** This bug has been marked as a duplicate of bug 667229 ***