• 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
Using a nib's window for a sheet?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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!


  • Follow-Ups:
    • Re: Using a nib's window for a sheet?
      • From: "Erik M. Buck" <email@hidden>
  • Prev by Date: Re: Action Still There
  • Next by Date: Editing a NSTextFieldCell with attributed string
  • Previous by thread: ANN: Pacifist beta 2 released
  • Next by thread: Re: Using a nib's window for a sheet?
  • Index(es):
    • Date
    • Thread