Re: How to implement window fade-in fade-out effects
Re: How to implement window fade-in fade-out effects
- Subject: Re: How to implement window fade-in fade-out effects
- From: Brian Christensen <email@hidden>
- Date: Wed, 4 Jun 2008 02:25:28 -0400
On Jun 4, 2008, at 2:01 , Markus Spoettl wrote:
Hello List,
I need someone to push me in the right direction as I have no idea
where to start:
I have an existing window which I'd like to show and hide using a
zooming transition effect. I'd like something similar to the one in
iCal (on Leopard) when you double click a calendar entry or in
Finder when you press SPACE on an item an the QuickLook window
becomes visible (same for hiding). How does one go about that?
I'm on 10.5.3 and I'm targeting 10.5. Right now I'm showing the
window using orderFrontAndMakeKey: and orderOut:
The window's frame is an animatable property, so you could try
something like this:
- (void)showWindow:(id)window
{
NSRect startFrom = NSZeroRect;
NSRect endAt = [window frame];
CGFloat duration = 5.0;
[window setFrame:startFrom display:NO];
[window orderFrontAndMakeKey:nil];
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:duration];
[[window animator] setFrame:endAt display:YES];
[NSAnimationContext endGrouping];
}
/brian
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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