Re: Determining which sheet closed with panels in separate nibs
Re: Determining which sheet closed with panels in separate nibs
- Subject: Re: Determining which sheet closed with panels in separate nibs
- From: Michael Watson <email@hidden>
- Date: Fri, 18 Apr 2008 00:45:43 -0400
I don't know why this didn't occur to me originally, but it's exactly
what I need. Thanks for the help, guys.
--
m-s
On 17 Apr, 2008, at 17:12, Jean-Daniel Dupas wrote:
Le 17 avr. 08 à 22:44, Sherm Pendley a écrit :
On Thu, Apr 17, 2008 at 3:49 PM, Michael Watson <mikey-
email@hidden>
wrote:
Inside of MainMenu.nib, I have my application's main window. Also in
MainMenu.nib is an NSObject subclass instance that is the main
window's
delegate.
In another nib, I have a panel and an NSObject subclass instance
that is
the panel's delegate. The panel is opened attached as a sheet to
the main
window.
When the sheet is closed on the main window, I need to do some
things, so
I implement -[NSWindow windowDidEndSheet:] in the main window's
delegate.
The problem is that I have other panels I attach as sheets to this
window in
different situations, and I need to distinguish between them so I
take the
correct action for the specific sheet that has closed.
When you open the sheet with
-
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo
:, assign
your controller as the delegate, and create a
-didEndSheet:returnCode:contextInfo: method in your controller.
That way,
the contextInfo that you specified when opening the sheet will be
passed
back to your delegate method when it closes.
sherm--
You can also specifiy a different selector for each sheet.
-didEndOpenFileSheet:returnCode:contextInfo:
-didEndOtherSheet:returnCode:contextInfo:
etc…
_______________________________________________
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