• 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
NSDocument beginSheet on a new document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDocument beginSheet on a new document


  • Subject: NSDocument beginSheet on a new document
  • From: Tod Cunningham <email@hidden>
  • Date: Mon, 22 Nov 2004 00:50:00 -0500

I would like to have a sheet auto open when a new document is created in an NSDocument project. Where is the best place to put the call to beginSheet? I have tried several places and none seem to work. Most interestingly the following doesn't work:

- (void)windowControllerDidLoadNib:(NSWindowController *) windowController
{
...


if( some_condition_that_requires_sheet_to_be_auto_opened )
{
[NSApp beginSheet:cabrilloHeaderPanel
modalForWindow:[windowController window]
modalDelegate:self
didEndSelector:@selector(editCabrilloHeadersDidEnd:returnCode: contextInfo:)
contextInfo:nil];
}
}


What happens is that the sheet gets opened, but not attached to the window (looks very odd as the sheet will have to title bar). The sheet opens before the window is visible and ends up detached. Any ideas on how to approach this?

- Tod

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSDocument beginSheet on a new document
      • From: Shaun Wexler <email@hidden>
  • Prev by Date: Re: How to disable/gray an NSTextfield (used as static text)
  • Next by Date: Re: NSDocument beginSheet on a new document
  • Previous by thread: Re: How to disable/gray an NSTextfield (used as static text)
  • Next by thread: Re: NSDocument beginSheet on a new document
  • Index(es):
    • Date
    • Thread