How to load a sheet in a separate Nib file
How to load a sheet in a separate Nib file
- Subject: How to load a sheet in a separate Nib file
- From: Fei Li <email@hidden>
- Date: Wed, 27 Aug 2003 15:41:00 -0600
Hello all,
It should be very simple, but I'm really stuck here.
I have a MainMenu.nib has a main window and a main controller. I want
pop up a sheet on the main window. I hope I can put the sheet panel in
another nib file, say sheet.nib, and has a sheetController in this nib
to control all the element on the sheet.
I have two problem:
1. I don't know the correct way to get the sheet panel. I connect the
sheetController and sheet to the main controller as outlets, so that
they are visible in main controller then use:
[NSBundle loadNibNamed: @"sheet" owner:sheetController ];
[NSApp beginSheet: sheet
modalForWindow: [self window]
modalDelegate: sheetController
didEndSelector: nil
contextInfo: nil];
[NSApp runModalForWindow: sheet];
...
[NSApp endSheet: sheet];
[sheet orderOut: self];
The sheet is displayed but the button on the sheet would not response
correctly( if I treat the sheet as window it will work fine). I wonder
what's the correct way to load the sheet.
2.The main window has been set by [window setFloatingPanel:YES], so the
sheet will show underneath the main window even if I also set
setFloatingPanel:YES or set window level to the same level of the main
window in sheetController's awakeFromNib.
If anybody have idea about this? I read some articles and document for
using sheet in cocoa, but they all put the sheet in the same nib file
of the main window and use main controller or the controller in the
main nib file to control the element on the sheet.
Thanks in advance for any information!
Fei
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.