> On 8 May 2015, at 6:11 am, Jerry Krinock <je...@ieee.org> wrote:
> 
> I would like to subclass NSSlider to make it work like the "volume control" 
> on a mid 19th-century radio receiver. That is, I want the minimum value to be 
> at 7 o'clock, and the maximum value to be at 5 o'clock. 


Jerry,

Since I found the problem interesting and also potentially useful for something 
of my own down the track, I thought I’d have a quick go at making a control 
like this.

It’s here: http://apptree.net/code/GCVolumeControl.zip


It’s fairly basic, though it does what you want with the positioning and 
stopping on tick marks, etc. I subclassed NSControl rather than NSSlider but I 
kept some of the same method names so it’s easy to swap in. The knob itself is 
just a PDF resource which I created using my own Artboard app (graphic and 
original file included). Obviously you can change this to anything you like - 
my quick and dirty image is likely a bit short of your needs.

Hopefully you find it useful, and at least having the source you can customise 
it easily compared to standard classes. No licensing issues from me either.

—Graham



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to