Using a nib's window for a sheet?
Using a nib's window for a sheet?
- Subject: Using a nib's window for a sheet?
- From: email@hidden
- Date: Tue, 4 Dec 2001 23:04:56 -0800
Hello everyone,
I'm writing my first Objective-C app, and I'd like to know the proper way
of loading a window from a nib, and then using that window as a sheet. In
other words, I'd like to do the following:
NSWindow *sheetWindow;
SEL mySelector;
NSApplication *theApp = [NSApplication sharedApplication];
[NSBundle loadNibNamed:@"SheetWindow" owner:myWindowOwner];
sheetWindow = /* Somehow retrieve the window for the nib I just loaded. */
mySelector = @selector(mySheetDidEnd:returnCode:contextInfo:);
[theApp beginSheet:sheetWindow modalForWindow:mainWindow modalDelegate:self
didEndSelector:mySelector contextInfo:nil];
I can think of several very bad ways to do this, such as getting all the applications
windows and looking for one that has the same title as the window I want. I
know that there must be a simple solution that I'm missing. Can anyone help
me out?
Thanks a bunch!