Re: Re: Re: NSSlider did finish sliding
Re: Re: Re: NSSlider did finish sliding
- Subject: Re: Re: Re: NSSlider did finish sliding
- From: "Michael Ash" <email@hidden>
- Date: Sat, 2 Sep 2006 14:41:07 -0400
On 9/2/06, Bruce Johnson <email@hidden> wrote:
Thanks, it was just what I needed.
Maybe you could give a small explanation as to the underlying machinery of:
[NSObject cancelPreviousPerformRequestsWithTarget: self selector: sel
object: sender];
I'm happy that it works, but what is it doing.
Remove the line and see what breaks!
With a continuous slider, the action method is sent every time the
slider's value changes. This means that the delayed perform is
potentially called many times. If you just had the delayed perform,
they would all pile up and you'd get dozens or hundreds of sliderDone:
messages once the mouse was released. By cancelling any pending
messages before adding a new one, you ensure that only a single
sliderDone: message is actually sent.
Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden