• 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: NSViewAnimation and fading in NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSViewAnimation and fading in NSWindow


  • Subject: Re: NSViewAnimation and fading in NSWindow
  • From: Murat Konar <email@hidden>
  • Date: Mon, 29 Jan 2007 13:29:49 -0800

On Jan 29, 2007, at 12:06 PM, Kevin wrote:

I have an NSWindow that I wish to fade in when my application starts. In IB, the "Visible at launch time" checkbox is unchecked so it's hidden when the app starts.

In applicationDidFinishLaunching:, I'm using the following code but it doesn't work:

NSDictionary *dict = [NSDictionary dictionary WithObjectsAndKeys:window, NSViewAnimationTargetKey, NSViewAnimationFadeInEffect,NSViewAnimationEffectKey,nil];

NSViewAnimation *animation = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict]];

[animation startAnimation]:
[animation release];

When my app runs, I don't see the window. The reverse, however, works. If I check the "Visible at launch time" checkbox, and change the animation effect to fade out, it works and the window fades out as soon as the app starts.

Am I missing something? I tried adding the start frame and end frame keys to the dictionary, but that didn't help.

Yes. Not "Visible at launch time" is not the same thing as "faded out". "Faded out" means that your window simply has an alphaValue of 0.


So... before you start the fade in, get a reference to your window, set its alpha to zero, call [window orderFront:self], then start the fade in.

_murat
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >NSViewAnimation and fading in NSWindow (From: "Kevin" <email@hidden>)

  • Prev by Date: Re: NSAttributedString and PDF
  • Next by Date: Initializing Subclass of NSTextContainer
  • Previous by thread: NSViewAnimation and fading in NSWindow
  • Next by thread: Initializing Subclass of NSTextContainer
  • Index(es):
    • Date
    • Thread