Re: Getting the final value from an NSSlider drag
Re: Getting the final value from an NSSlider drag
- Subject: Re: Getting the final value from an NSSlider drag
- From: Roland King <email@hidden>
- Date: Wed, 30 Dec 2015 07:31:34 +0800
>
> If you want to know when the last value is sent during mouse tracking, set the ‘actionOn’ property to mouse-up.
>
> So, something like this:
>
> - (void)viewDidLoad
> {
> [super viewDidLoad];
>
> self.slider.action = @selector(valueChangedFinally:);
> self.slider.target = self;
> [self.slider sendActionOn:NSLeftMouseUpMask];
> }
>
> - (IBAction)valueChangedFinally:(id)sender
> {
> NSLog(@“Here is the final slider value upon mouse up:%@", [sender stringValue]);
> }
>
> Presumably the other bindings/etc. code would still work to update your real-time display.
>
> Doug Hill
No they don’t - changing that to to NSLeftMouseUpMask has a similar effect to turning off ‘continuous’, all clients get one event, at the end, so the live updating realtime display doesn’t work.
_______________________________________________
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