Re: Suggestions for forcing NSSlider to some values, without tickmarks
Re: Suggestions for forcing NSSlider to some values, without tickmarks
- Subject: Re: Suggestions for forcing NSSlider to some values, without tickmarks
- From: Marco Tabini <email@hidden>
- Date: Thu, 01 Mar 2012 18:11:00 -0500
On 2012-03-01, at 4:18 PM, Sean McBride wrote:
> Hi all,
>
> I have a continuous linear NSSlider who's range is -180 to 180 degrees. I don't want tick marks because any value is acceptable. However, the value zero is important, and I need for the user to be able to get to exactly 0.0 (0.1 or whatever is no good).
>
> How would you suggest accomplishing this?
Off the top of my head, I would simply fence the NSSlider to zero when its value is within a given range from that value: on a change event, if (say) -5 ≤ 0 ≤ 5, you can force the value to zero. You can then allow for finer tuning of the value by implementing the fencing only when the user moves the slides with the mouse, and instead allow any value when the user uses the arrow keys to reposition the slider's knob.
—Mt.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden