How to create custom NSSlider that is working exactly as slider in System Preferences -> Desktop & Screen Saver -> Screen Saver -> Start screen saver: ?
I tried to subclass NSSliderCell with overridden continueTracking: but it don't work as expected.
I played around for a bit and at least got off to a pretty good start with an
NSSliderCell
subclass.MDSliderCell.h
:MDSliderCell.m
:Basically, during the
-continueTracking:at:inView:
, it checks to see how close it is to a tick mark, and if it's close enough, it turns on the option to only allow tick mark values. That causes it to snap to the tick mark, then once you get far enough away, you turn the "tick mark-only" option off until you get close enough to another tick mark.