Re: Getting the final value from an NSSlider drag

2015-12-30 Thread Doug Hill
> On Dec 29, 2015, at 3:31 PM, Roland King wrote: > >> >> 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 =

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Graham Cox
> On 30 Dec 2015, at 9:45 AM, Ken Thomases wrote: > > This gives false positives if the user simply stops moving the mouse but > doesn't release the mouse button. There's no delay you can specify that > avoids this, since there's no upper bound to how long the user can hold the > mouse butto

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Roland King
>> >> 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

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Lee Ann Rucker
> On Dec 29, 2015, at 3:51 PM, Roland King wrote: > > >> On 30 Dec 2015, at 05:53, Lee Ann Rucker 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 set

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Uli Kusterer
> On 29 Dec 2015, at 23:45, Ken Thomases wrote: > > On Dec 29, 2015, at 5:44 AM, Graham Cox wrote: >> >> On 29 Dec 2015, at 7:44 PM, Roland King wrote: >>> >>> I can subclass NSSlider or possibly NSSliderCell but that sounds like a >>> whole world of pain, if I have to do that I’ll probably

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Roland King
> On 30 Dec 2015, at 05:53, Lee Ann Rucker 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 > k

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Roland King
> > 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;

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Doug Hill
> On Dec 29, 2015, at 2:45 PM, Ken Thomases wrote: > > On Dec 29, 2015, at 5:44 AM, Graham Cox > wrote: >> >> On 29 Dec 2015, at 7:44 PM, Roland King wrote: >>> >>> I can subclass NSSlider or possibly NSSliderCell but that sounds like a >>> whole world of pain

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Ken Thomases
On Dec 29, 2015, at 5:44 AM, Graham Cox wrote: > > On 29 Dec 2015, at 7:44 PM, Roland King wrote: >> >> I can subclass NSSlider or possibly NSSliderCell but that sounds like a >> whole world of pain, if I have to do that I’ll probably just put a >> coalescing delay into the whole thing which

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Lee Ann Rucker
> On Dec 29, 2015, at 12:44 AM, Roland King wrote: > > I have some NSSliders hooked up on my UI to text fields with formatters, all > set up with bindings so that the label shows the slider value. The sliders > are continuous, looks fine, nice feedback for whoever’s driving. > > However I wa

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Graham Cox
> On 29 Dec 2015, at 7:44 PM, Roland King wrote: > > I can subclass NSSlider or possibly NSSliderCell but that sounds like a whole > world of pain, if I have to do that I’ll probably just put a coalescing delay > into the whole thing which waits 1/2 second after an update before it > actually

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Roland King
> On 29 Dec 2015, at 17:54, Quincey Morris > wrote: > > On Dec 29, 2015, at 01:45 , Roland King > wrote: >> >> 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 >> w

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Quincey Morris
On Dec 29, 2015, at 01:45 , Roland King wrote: > > 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 Yeah,

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Roland King
> On 29 Dec 2015, at 17:40, Quincey Morris > wrote: > > On Dec 29, 2015, at 00:44 , Roland King > 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==

Re: Getting the final value from an NSSlider drag

2015-12-29 Thread Quincey Morris
On Dec 29, 2015, at 00:44 , Roland King 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? ___ Cocoa-dev mailing list (Coc