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 (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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to