Skip navigation.
 
mlRe: Why click to knob of NSSlider changes it's value?
FROM : Andrey Tverdokhleb
DATE : Mon Apr 30 19:44:18 2007

On Apr 29, 2007, at 17:37, Matt Neuburg wrote:

> On Sat, 28 Apr 2007 21:37:16 -0700, Andrey Tverdokhleb 
> <<email_removed>>
> said:

>> May be this is a stupid problem, but I just can't find a solution and
>> hope somebody here knows what to do.
>> I have a simple NSSlider, min: -40, max: 60, 11 ticks, continuos, no
>> sticking to ticks. Starting value is 0.
>> When I click knob of the slider for the first time it sends value
>> -0.81081032752990723 through bindings. When I click it again it
>> doesn't do this. If I change it's value to 0 programatically and
>> click the knob again it sends -0.81081032752990723 again. What I
>> don't understand why it's changing value on simple click considering
>> that sticking to ticks is disabled. I tried to change amount of ticks
>> - doesn't affect anything. Changing range changes that number, but
>> the range has to be (-40; 60).

>
> If you change the physical length of the slider you'll get a different
> number. Also you'll see the same phenomenon for any initial value 
> (not just
> 0). Presumably this behavior has to do with the interface 
> resolution: the
> physical interface isn't capable of the degree of precision you're
> expecting. If this is troublesome, it could be a reason for turning on
> "sticking to ticks".


This would probably work, but 101 ticks is bit too much for that 
slider -
looks ugly, and I don't know how to prevent them from drawing.

> On the other hand, since -0.81... is as near as the
> user is going to be able to move the slider to zero anyway, why not 
> just
> accept this value? m.


I've no problems with precision or minimal step, but sliding has
to be relative to current slider's value and not to some semi-random 
number depending
on slider shape or size - changing slider type from small to mini or 
regular does
affect that shift also.
In any case value of the slider should not change from simple knob
clicking - no drag, no change. Overall NSSlider is just unpredictable 
and
I can't bind it directly to my variables.

Andrey

Related mailsAuthorDate
mlWhy click to knob of NSSlider changes it's value? Andrey Tverdokhleb Apr 29, 06:37
mlRe: Why click to knob of NSSlider changes it's value? Matt Neuburg Apr 30, 02:37
mlRe: Why click to knob of NSSlider changes it's value? Andrey Tverdokhleb Apr 30, 19:44