Re: What is the best way to get an NSSlider to respond to the mouse scroll wheel?
Re: What is the best way to get an NSSlider to respond to the mouse scroll wheel?
- Subject: Re: What is the best way to get an NSSlider to respond to the mouse scroll wheel?
- From: Bill Bumgarner <email@hidden>
- Date: Thu, 27 Nov 2008 16:46:55 -0800
On Nov 28, 2008, at 11:24 AM, Graham Cox wrote:
Playing with this, the code below gives a nice "feel" for a big
variety of sliders in my app and wraps properly with circular ones
too. I was skeptical at first that this was a good idea but trying
it out in the app I've quickly come to appreciate how usable it is
in practice!
@implementation NSSlider (Scrollwheel)
Do Not Do This. Down this path lies pain and madness.
Implement a subclass and use it throughout your application.
The first software update or major Mac OS X release where Apple adds
said method, if Apple were to ever add said method, and you'll be
quite thoroughly unhappy. At best, your app's standard sliders will
behave in a decidedly non-standard fashion. At worst, your app's
standard sliders will crash.
Categories are great for dividing a class's implementation (sometimes
across frameworks -- NSAttributedString in Foundation and AppKit, for
example) and great for adding new functionality to existing classes in
isolation. But they are not meant for and not good for overriding
existing behavior or modifying an existing class to respond to
existing behaviors in a new way.
b.bum
_______________________________________________
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