Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
- Subject: Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
- From: Markus Spoettl <email@hidden>
- Date: Fri, 16 Mar 2012 21:38:46 +0100
On 16.03.12 20:29, Seth Willits wrote:
Can you dispatch_async(main_queue, ^{ if (did not start momentum)
cleanUp(); }); to insert that after the next handling of the event
loop which should either start the momentum cycle or not (if it isn't
needed)? I don't know if that cycle is guaranteed to start on the
next event loop cycle or not. Actually come to thinking of it, that
dispatch probably gets executed at the end of the current event loop
run anyway.
Starting immediately doesn't work because the momentum phase takes a
little to get going. What I'm doing now is using
-performSelector:withObject:afterDelay: with a delay of about 0.1
seconds. It's soon enough to work for my cleanup and late enough to
ensure the momentum phase has started which takes about 0.04-0.05
seconds after the last regular phase event.
Perhaps there's a better time to do cleanup altogether?
I'm hoping there is one, I'm not happy with the way its working right
now. Thanks anyway!
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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