Re: NSViewAnimation vs Distributed Notification: Bug?
Re: NSViewAnimation vs Distributed Notification: Bug?
- Subject: Re: NSViewAnimation vs Distributed Notification: Bug?
- From: Steven Degutis <email@hidden>
- Date: Sat, 27 Feb 2010 18:35:28 -0500
Firstly, you do not need to check if tAnimation is nil, since sending a
message to nil is valid in ObjC. So I would personally remove that if() and
just de-indent all the code that's inside it.
Secondly, I *think* what you're running into is the fact that "blocking
mode" means the main thread blocks, and thus does not receive any
distributed notifications. The second snippet of code (the one that works
fine) does not animate on the main thread, thus everything works correctly.
If you want to use NSViewAnimation for some reason (but I wouldn't), then
you can change the mode away from blocking-mode to something more
background-thread-y.
-Steven
On Sat, Feb 27, 2010 at 6:24 PM, Iceberg-Dev <email@hidden> wrote:
> [Q] Is there a known bug in NSViewAnimation on Mac OS X 10.4 when it comes
> to Distributed Notifications?
>
> Scenario:
> ---------
>
> If I animate a window resizing through a NSViewAnimation, some Distributed
> Notifications are only taken into account after I click in the window
> resized through a NSViewAnimation.
>
> If I animate the window with setFrame:dispplay:animate:, the problem does
> not occur.
>
> ------->8------->8------->8------->8------->8------->8------->8-------
>
> // This does not work correctly
>
> tAnimationDictionary=[NSDictionary
> dictionaryWithObjectsAndKeys:IBwindow_,NSViewAnimationTargetKey,
> [NSValue
> valueWithRect: tNewWindowFrame], NSViewAnimationEndFrameKey,
> nil];
>
> tAnimation=[[NSViewAnimation alloc] initWithViewAnimations: [NSArray
> arrayWithObject:tAnimationDictionary]];
>
> if (tAnimation!=nil)
> {
> [tAnimation setAnimationBlockingMode:NSAnimationBlocking];
>
> [tAnimation setDuration: 0.15f];
>
> [tAnimation startAnimation];
>
> [tAnimation autorelease];
> }
>
> // This works fine
>
> [IBwindow_ setFrame:tNewWindowFrame display:YES animate:YES];
>
>
> _______________________________________________
>
> 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
>
--
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.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