GNOME Bugzilla – Bug 727294
Gtk SpinButton Size Greater than Screen Width
Last modified: 2016-01-28 04:33:03 UTC
Created attachment 273231 [details] Display SpinButton Resize Behaviour with sys.float_info.max as upper limit Hi, I filed a bug against banshee (bug 723811) but it appears the cause is a regression in gtk+3. The default SpinButton, when set to use the maximum value for floats as its upper limit causes its parent window to take up more than the screen width. As a workaround, we found that using the maximum value for integers works ok. I attach a test case which shows the behaviour using gtk+ 3.10.7. Thanks!
The GtkAdjustment constructor receives a gdouble (https://developer.gnome.org/gtk3/stable/GtkAdjustment.html#gtk-adjustment-new), not a float.
What's a double in python?
Pretty sure float is the correct type: http://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-long-complex
Well, you beat me about python knowledge definitely. (In reply to comment #0) > Hi, I filed a bug against banshee (bug 723811) but it appears the cause is a > regression in gtk+3. Just wanted to clarify this bit, in case anyone else besides us is reading: gtk2 does not exhibit this behaviour. In that case, you can scroll the spinbutton textbox horizontally with the arrow keys in the keyboard, but the spinbutton doesn't render so wide.
The problem is that the SpinButton prepares itself to accommodate the largest value and that's why it becomes so wide. It would be useful if the documentation mentions that setting a very high upper or very low lower leads to a huge width of the widget.
Capping the number of digits at a reasonable value would make sense to me.
I decided to just document the best practice for avoiding this issue.