[pygtk] nonlinear scale widget

A.T.Hofkamp a.t.hofkamp at tue.nl
Tue May 27 19:23:52 WST 2008


Hello all,

I'd like to have a nonlinear scale widget from about 1/10 to 10, where 1 is 
near the center of the scale.

The gtk library seems to assume a linear scale only, so the question is how to 
do this.


The simplest approach would be to make a function that translates the linear 
scale from the adjustment to my nonlinear scale. Although I haven't 
implemented it yet, I have no doubt this will work, so internally I can have a 
nice nonlinear value coming out of the scale.

However, the user will still see the linear scale (displayed by the Scale 
widget). I couldn't find a hook to change this displayed value.



The other approach I can think of is to make a non-linear Adjustment class. 
That would fix the display seen by the user, but it breaks the entire 
step/page concept (which are also non-linear otherwise the '1' cannot be 
centered), so I fear it will cause much more trouble than I can handle.


Both approaches seem to be broken in their own way.
Does anybody have suggestions on how to make such a nonlinear scale?

Sincerely,
Albert


More information about the pygtk mailing list