• 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: Displaying a sheet immediately after a window is opened
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying a sheet immediately after a window is opened


  • Subject: Re: Displaying a sheet immediately after a window is opened
  • From: Markus Spoettl <email@hidden>
  • Date: Fri, 17 Aug 2012 13:27:54 +0200

On 8/16/12 5:02 AM, Rick Mann wrote:
After googling, I found that in -[NSDocument windowControllerDidLoadNib], I
had to begin my sheet by calling performSelector on the main thread (actually
I scheduled a block operation). This is kinda gross, but seems to work.

Unfortunately, the result is that the main window animates opening
simultaneously with the sheet animating open.

I'd really like the sheet to begin its animation after the main window
finishes its own. Is there a "right" place to do this?

Don't know about right place, I'm doing this by overwriting -showWindow: in the window controller, firing a delayed performSelector with 0.5 seconds delay. I also tried -windowDidLoad but as you noticed, the animation isn't complete when it being called. Long story short:

- (void)showWindow:(id)sender
{
  [super showWindow:sender];

  [self performSelector:@selector(showMySheet:)
             withObject:nil
             afterDelay:0.5];
}

Works well for me, both on Lion and Mountain Lion.

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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

References: 
 >Displaying a sheet immediately after a window is opened (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Displaying a sheet immediately after a window is opened
  • Next by Date: NSBrowser fills NSPasteboard but won't drop
  • Previous by thread: Re: Displaying a sheet immediately after a window is opened
  • Next by thread: Re: Displaying a sheet immediately after a window is opened
  • Index(es):
    • Date
    • Thread