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 727294 - Gtk SpinButton Size Greater than Screen Width
Gtk SpinButton Size Greater than Screen Width
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkSpinButton
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-03-29 14:30 UTC by Nicholas Little
Modified: 2016-01-28 04:33 UTC
See Also:
GNOME target: ---
GNOME version: 3.9/3.10


Attachments
Display SpinButton Resize Behaviour with sys.float_info.max as upper limit (434 bytes, text/x-python)
2014-03-29 14:30 UTC, Nicholas Little
Details

Description Nicholas Little 2014-03-29 14:30:50 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!
Comment 1 Andrés G. Aragoneses (IRC: knocte) 2014-03-29 14:45:13 UTC
The GtkAdjustment constructor receives a gdouble (https://developer.gnome.org/gtk3/stable/GtkAdjustment.html#gtk-adjustment-new), not a float.
Comment 2 Nicholas Little 2014-03-29 14:52:41 UTC
What's a double in python?
Comment 3 Nicholas Little 2014-03-29 14:56:10 UTC
Pretty sure float is the correct type: http://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-long-complex
Comment 4 Andrés G. Aragoneses (IRC: knocte) 2014-03-29 15:25:24 UTC
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.
Comment 5 Alex Băluț 2015-10-29 16:50:22 UTC
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.
Comment 6 Matthias Clasen 2015-10-30 00:54:28 UTC
Capping the number of digits at a reasonable value would make sense to me.
Comment 7 Matthias Clasen 2016-01-28 04:33:03 UTC
I decided to just document the best practice for avoiding this
issue.