Hi there!
In my application (using gtkmm-4.0), I’d like to restrict the values of a GtkScale such that only odd numbers can be entered. So far I’ve checked the docs and found the “step-increment” property on GtkAdjustment – but setting this property doesn’t seem to change the behaviour of the GtkScale
Here’s the relevant snippet of my XML:
...
<object class="GtkScale">
<property name="round-digits">0</property>
<property name="draw-value">1</property>
<property name="adjustment">
<object class="GtkAdjustment">
<property name="lower">1</property>
<property name="upper">99</property>
<property name="step-increment">2</property>
<property name="value">11</property>
</object>
</property>
</object>
...
I could probably subclass GtkScale and implement the desired behaviour, but surely there’s a way to do this with GtkScale/GtkAdjustment already?
Another thing - with “draw-value” set, the GtkScale shows its current value above the slider. Is there a way to show this as an integer (ie. with no decimal point)? Having <property name="round-digits">0</property>
does seem to work in that only integer values are shown, but the decimal point is still there.
Any help is greatly appreciated!