• 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
closing a sheet from another controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

closing a sheet from another controller


  • Subject: closing a sheet from another controller
  • From: John Love <email@hidden>
  • Date: Thu, 24 Jun 2010 09:09:05 -0400

I use one of the standard approaches to opening a NSWindowController sheet; that is, my external Controller calls:

	[NSApp beginSheet:...]

each of the IB buttons are connected via IBActions that close the sheet via:

	[NSApp stopModal];   // sender = NSButton and [sender window] = sheet
	[NSApp endSheet:[sender window] returnCode:theCode];   // calls didEndSelector:

The didEndSelector: looks like:

- (void )sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo

which calls:

	[sheet orderOut:self];

Fairly standard stuff, but here's the rub.  If a error in my app occurs while this sheet is displayed, I want to be able to dismiss the sheet from a external Controller and display an appropriate status message in the sheet's parent window; for example, the external app document (that my application is chewing on) unexpectedly closes.  My sheet knows the external Controller that calls +beginSheet: because this external Controller's identity is passed to the method which calls +beginSheet:.

Based on my previous history, there is probably something plainly simple, but I'm just missing it.

Thanks in advance,

John Love
Touch the Future! Teach!



_______________________________________________

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: closing a sheet from another controller
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Exit( ) necessary? (oalTouch sample project)
  • Next by Date: Re: File descriptors not freed up without a -closeFile call
  • Previous by thread: Re: Exit( ) necessary? (oalTouch sample project)
  • Next by thread: Re: closing a sheet from another controller
  • Index(es):
    • Date
    • Thread