Re: Temporarily disabling all input events while non-blocking animations are playing
Re: Temporarily disabling all input events while non-blocking animations are playing
- Subject: Re: Temporarily disabling all input events while non-blocking animations are playing
- From: Oleg Krupnov <email@hidden>
- Date: Wed, 30 Sep 2009 15:17:08 +0300
Let me answer my own question myself, because I have found a
(seemingly) good way -- using run loops in NSEventTrackingRunLoopMode
mode, like the [NSView dragImage::::] does.
// end date to make sure the run loop will be endless in case of a
program mistake
NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow:5.0];
// some exit flag set somewhere else
m_someExitFlag = false;
do
{
[[NSRunLoop currentRunLoop] runMode:NSEventTrackingRunLoopMode
beforeDate:endDate];
}
while ([(NSDate*)[NSDate date] compare:endDate] == NSOrderedAscending
&& !m_someExitFlag);
On Thu, Aug 27, 2009 at 3:35 PM, Oleg Krupnov <email@hidden> wrote:
> Hi,
>
> I'd like my app to block while an animation is playing. Normally, I
> would simply use a blocking animation, but now I have two short
> animations playing simultaneously, so I have to make them both
> non-blocking. How do I block the app in this case? Basically I'd like
> to prevent the user from (inadvertently) interacting with the app
> while the animations are in progress, because the app may go into an
> invalid state.
>
> Thanks!
>
_______________________________________________
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