> On 29 Dec 2015, at 17:40, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Dec 29, 2015, at 00:44 , Roland King <r...@rols.org > <mailto:r...@rols.org>> wrote: >> >> I want to capture, in the app, the value of the slider only at the end when >> the mouse goes up, once > > Isn’t that what the NSControl property continuous==false is for?
But as I said in the post - the slider is hooked up via bindings in the UI to a label which shows the value *as you slide it*, so it needs to be continuous for that purpose. Then when you let go, only then do I want the final value to be delivered to the app. were it simply a matter of turning continuous off I wouldn’t have had a problem. Surprisingly enough the thing I assumed would be the hardest, turned out to be the easiest, mouseDown is documented to start a local event loop capture and it doesn’t return until it’s all over .. so it just took this. import Cocoa public protocol RKEndValueSliderTarget : NSObjectProtocol { func sliderValueChangeEnded( slider : NSSlider ) } public class RKEndValueSlider: NSSlider { public var endValueReceiver : RKEndValueSliderTarget? public override func mouseDown( theEvent : NSEvent ) { super.mouseDown( theEvent ) endValueReceiver?.sliderValueChangeEnded( self ) } } _______________________________________________ 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