• 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: What is the best way to get an NSSlider to respond to the mouse scroll wheel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Graham Cox <email@hidden>
  • Date: Fri, 28 Nov 2008 04:08:45 +1100


On 28 Nov 2008, at 3:18 am, Michael A. Crawford wrote:

I assume I can sub-class the control but I wondering if there is a better way. I'm using a circular slider and would like it to rotate when I roll the scroll wheel up or down.



You can just implement the -scrollWheel: method in a category. For example:


@implementation NSSlider (Scrollwheel)


- (void) scrollWheel:(NSEvent*) event { [self setFloatValue:[self floatValue] + [event deltaY]]; [self sendAction:[self action] to:[self target]]; }


@end


hth,


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: What is the best way to get an NSSlider to respond to the mouse scroll wheel?
      • From: Graham Cox <email@hidden>
    • Re: What is the best way to get an NSSlider to respond to the mouse scroll wheel?
      • From: "Michael Ash" <email@hidden>
References: 
 >What is the best way to get an NSSlider to respond to the mouse scroll wheel? (From: "Michael A. Crawford" <email@hidden>)

  • Prev by Date: Re: Can I split an implementation file?
  • Next by Date: Re: Can I split an implementation file?
  • Previous by thread: What is the best way to get an NSSlider to respond to the mouse scroll wheel?
  • Next by thread: Re: What is the best way to get an NSSlider to respond to the mouse scroll wheel?
  • Index(es):
    • Date
    • Thread