[pygtk] restrict Hscale moves
remi.sassolas at gmail.com
remi.sassolas at gmail.com
Mon Feb 27 18:43:01 WST 2006
Hi everybody,
Here is my problem :
I want to use an Hscale to select an integer. This Hscale shares its
Adjustment with a Spinbutton, so that when one of them is modified the other
is automagically modified in the same way.
So actually there are two ways to select an integer : thanks to the HScale
or thanks to the Spinbutton.
The Spinbutton works well, but I have the problem with the Hscale (hence
this mail !) : it doesn't respect the step (which is equal to 1, as I want
to select integers).
I mean the slider can be moved in a continuous way, whereas I would like it
to move in a discrete way.
I've found two ways to solve my problem :
- the first one consists in having the value of the Hscale displayed, with
its digits set to 0. But I'd prefer had the value displayed in the entry box
of the Spinbutton...
- the second one consists in setting a callback for the 'value_changed'
event, which get the current value of the Hscale and set it to nearest
integer value. But it's not a very nice workaround to my mind...
So does anybody know a nicer way to solve my problem ?
By the way if someone knows a simple way to graduate a Hscale, I would be
much interested too.
Thanks in advance !
--
Remi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20060227/35ce72ad/attachment.htm
More information about the pygtk
mailing list