• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Suggestions for forcing NSSlider to some values, without tickmarks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestions for forcing NSSlider to some values, without tickmarks


  • Subject: Re: Suggestions for forcing NSSlider to some values, without tickmarks
  • From: Graham Cox <email@hidden>
  • Date: Fri, 02 Mar 2012 10:31:29 +1100

On 02/03/2012, at 8:18 AM, 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?
>
> (In the past, I cheated and forced the slider to be an even number of pixels long, which did the job.  This fragile solution broke in 10.7.)


You could just round the values received to the nearest whole number.

I guess what might be nice is a tendency for it to "snap" to the zero position when the slider is dragged close to it. You might be able to do that with a standard slider by manipulating the values close to the zero point, but to get this really working well you'd probably want a subclass of NSSliderCell - you'd probably also want to have some sort of override, such as when the option key is pressed, otherwise it will be impossible to set values very close to 0, such as 1.


--Graham



_______________________________________________

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


  • Follow-Ups:
    • Re: Suggestions for forcing NSSlider to some values, without tickmarks
      • From: Sean McBride <email@hidden>
References: 
 >Suggestions for forcing NSSlider to some values, without tickmarks (From: Sean McBride <email@hidden>)

  • Prev by Date: Re: Xcode - An Apple Embarrassment
  • Next by Date: Re: iPhone search and notification widgets
  • Previous by thread: Re: Suggestions for forcing NSSlider to some values, without tickmarks
  • Next by thread: Re: Suggestions for forcing NSSlider to some values, without tickmarks
  • Index(es):
    • Date
    • Thread