• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Window Animation with setFrame:display:animate: Flickers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window Animation with setFrame:display:animate: Flickers


  • Subject: Re: Window Animation with setFrame:display:animate: Flickers
  • From: Mike Abdullah <email@hidden>
  • Date: Sat, 21 Feb 2009 11:14:37 +0000

Did you need to target anything pre-Leopard? If not, I'd recommend using Core Animation instead of this method. It'll have the advantage of being GPU-powered and more importantly won't block the main thread during the animation (I frequently try to move the System Prefs somewhere more convenient while a pane is loading, and it annoyingly snaps back into place).

Mike.

On 21 Feb 2009, at 02:31, K. Darcy Otto wrote:

I have a window, and get that window to resize according to the various custom views I plop in the window. My purpose here is to (somewhat) emulate the system preferences window that grows and shrinks as necessary. The resizing works fine, but when I want to animate the resizing, there is a lot of flickering in the window. Here is the short bit of code:

[w setContentView:nil];
[w setFrame:windowFrame display:YES animate:YES];
[w setContentView:v];

... where "w" is an NSWindow, and "v" is an NSView. "windowFrame" is the recalculated window size that fits the view. So far, I have tried to solve the flickering by subclassing NSWindow and implementing the following override:

- (NSTimeInterval)animationResizeTime:(NSRect)newFrame
{
   return 1.0;
}

But while this does slow down the animation significantly, it simply makes the flickering slower.

Is there a way to use setFrame:display:animate: so that the background of the window does not flicker?

Thanks.
_______________________________________________

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

_______________________________________________

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


  • Follow-Ups:
    • Re: Window Animation with setFrame:display:animate: Flickers
      • From: "K. Darcy Otto" <email@hidden>
References: 
 >Window Animation with setFrame:display:animate: Flickers (From: "K. Darcy Otto" <email@hidden>)

  • Prev by Date: How to get the "white shadow" effect when drawing NSStrings?
  • Next by Date: Re: How to get the "white shadow" effect when drawing NSStrings?
  • Previous by thread: Re: Window Animation with setFrame:display:animate: Flickers
  • Next by thread: Re: Window Animation with setFrame:display:animate: Flickers
  • Index(es):
    • Date
    • Thread