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 351755 - GTK_RANGE (range) -> round_digits should be exposed as a property
GTK_RANGE (range) -> round_digits should be exposed as a property
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.99.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 597610
 
 
Reported: 2006-08-17 13:39 UTC by Simon Budig
Modified: 2011-01-15 05:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Property and accessors for GtkRange::round_digits (7.68 KB, patch)
2011-01-13 14:26 UTC, Christian Dywan
reviewed Details | Review
178226: Property and accessors for GtkRange::round_digits #2 (8.47 KB, patch)
2011-01-13 14:55 UTC, Christian Dywan
none Details | Review

Description Simon Budig 2006-08-17 13:39:41 UTC
Please describe the problem:
GtkRange has a member variable called "round_digits" that rounds the value to a certain abount of digits. In particular if round_digits = 0 the Range enables a "stepping" behaviour for GtkScale, which is IMHO very useful for some applications.

IMHO this should be exposed better in the API, at least don't hide this feature in the documentation for the "change-value" signal, maybe even make a real property for it.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Christian Dywan 2011-01-13 13:36:25 UTC
This actually needs public API now that it's sealed. The private member is still documented.
Comment 2 Christian Dywan 2011-01-13 14:26:36 UTC
Created attachment 178226 [details] [review]
Property and accessors for GtkRange::round_digits
Comment 3 Javier Jardón (IRC: jjardon) 2011-01-13 14:32:10 UTC
Review of attachment 178226 [details] [review]:

Only some minor comments about gtk-doc notation

::: gtk/gtkrange.c
@@ +389,3 @@
    * the ::change-value signal is responsible for clamping the value to
    * the desired number of decimal digits; the default GTK+ handler 
+   * clamps the value based on "round-digits".

You can use #GtkRange:round-digits here

@@ +501,3 @@
+   *
+   * Sets the number of widgets to round the value to when
+   * it changes. See ::change-value.

#GtkRange::change-value

@@ +4087,3 @@
+ *
+ * Sets the number of widgets to round the value to when
+ * it changes. See ::change-value.

#GtkRange::change-value

@@ +4107,3 @@
+ *
+ * Sets the number of widgets to round the value to when
+ * it changes. See ::change-value.

#GtkRange::change-value
Comment 4 Michael Natterer 2011-01-13 14:39:23 UTC
A minumin property value of -G_MAXINT doesn't make sense here,
it should be 0.
Comment 5 Christian Dywan 2011-01-13 14:55:24 UTC
Created attachment 178231 [details] [review]
178226: Property and accessors for GtkRange::round_digits #2

Thanks for the quick comments! I fixed the property and signal syntax, including the already present signal names in the change-value signal.

Mitch, I actually realised -1 should be minimum and default here, the spin button actually uses that to unset the value. I added a return_if_fail as well for that.
Comment 6 Matthias Clasen 2011-01-15 05:01:57 UTC
"Sets the number of widgets to round to" is a funny typo