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:51:55 +0800
> On 30 Dec 2015, at 05:53, Lee Ann Rucker <email@hidden> wrote:
>
>
>>
>
>
> Actually it's easy. For very similar reasons I needed the same behavior - live update of the slider's temp value for UI elements, but only call the final setter when the user is done. I subclassed NSSlider's keyUp: and keyDown: to call super and then call my own delegate method "sliderDidEndUpdate:"
>
Never drove a slider with the keyboard before, so I added a keyDown and keyUp method to the mouseDown: one I posted earlier, with a bit of code to try and be smart about when to send updates, so you don’t get them if you’re just tabbing though. Seems to work well enough for this use-case, keyboard and mouse, live update on the screen, one update at the end, 15 lines of code and no need to artificially compress the events.
_______________________________________________
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