On Thu, Apr 17, 2008 at 3:49 PM, Michael Watson <[EMAIL PROTECTED]> 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-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
