On May 28, 2013, at 10:16:07, Scott Ribe <scott_r...@elevated-dev.com> wrote:

> On May 28, 2013, at 8:41 AM, Torsten Curdt wrote:
> 
>> Any easier or more elegant way you could think of?
> 
> Well, if you don't want to deal with a queue and background thread, use 
> NSTimer. In setValue, cancel the timer if it exists, then create a new one 
> scheduled to run .someting seconds. If a timer ever fires, do your 
> calculation.
> 
> Now if you *want* an occasional intermediate update while the user is 
> dragging, then compare values or current time in setValue...

If you do that last idea, you'll have to make sure you have the final value get 
set on mouseUp, otherwise you might be ignoring it because not enough time has 
passed. If the value this slider is setting takes too much time to process, 
consider letting the calculation process after mouseUp, and let the slider 
change its value naturally.

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157




_______________________________________________

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

Reply via email to