[SOLVED] CAAnimation while modalForApp
[SOLVED] CAAnimation while modalForApp
- Subject: [SOLVED] CAAnimation while modalForApp
- From: David LeBer <email@hidden>
- Date: Wed, 21 Jan 2009 21:00:09 -0500
On 21-Jan-09, at 6:23 PM, David LeBer wrote:
I have a sign in window that implements a simple CAKeyframeAnimation
to perform a shake if the sign in fails using the NSWindow's
animator proxy object.
i.e.
[self setAnimations:[NSDictionary dictionaryWithObject:[self
shakeAnimationWithNumber:4 duration:0.5f vigour:0.03f]
forKey:@"frameOrigin"]];
[[self animator] setFrameOrigin:[self frame].origin];
However, I need to make the app modal for that window, and when I do
the animation doesn't fire (or isn't visible).
Anyone have any idea of what I should be looking for in the
documentation to explain this? Is there some kind of run-loop mode
dependency I am not aware of?
To answer my own question. I took a WAG that this was run-loop issue
and tried this hint:
<http://www.dejal.com/blog/2007/01/cocoa-topics-case-modal-webview>
I switched the opening of the window from runModalForWindow: to
beginModalSessionForWindow: + runModalSession with a tickle of
[[NSRunLoop currentRunLoop] limitDateForMode:NSDefaultRunLoopMode]
each time through the loop.
The shake animation now happens as expected. I have no idea whether
there is a different/better way of handling this but it is working now.
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
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