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: "Sean McBride" <email@hidden>
- Date: Wed, 4 Jun 2008 11:32:41 -0400
- Organization: Rogue Research
On 6/4/08 2:25 AM, Brian Christensen said:
>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];
>}
That'll work, but in my experience if any of the controls in the window
make use of 'autoresizing springs' then they will resize incorrectly if
starting from a window size smaller that the control's minimum size.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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