Sheet Doesn't Attach Itself To Window
Sheet Doesn't Attach Itself To Window
- Subject: Sheet Doesn't Attach Itself To Window
- From: "Brian T. Kelley" <email@hidden>
- Date: Wed, 28 Nov 2007 14:53:37 -0500
Hello,
I'm trying to display a sheet in Leopard but I've run into a peculiar
situation, for which I cannot find anyone who has shared a similar
experience. I can display a sheet but it is not attached to the
window. When the sheet appears (i.e. it just shows up, no animation)
it is properly centered on its window. I can click on the title bar of
the owner window and move that window around but the sheet remains in
its original location. If anyone could advise me on how to correct the
problem, I'd greatly appreciate it.
I call NSApp's
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:
method. I've verified that no nil values, other than contextInfo are
being passed to the method. The code that displays the sheet is as
follows:
[NSApp beginSheet:self.sheetWindowController.window
modalForWindow:self.window
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
[NSApp runModalForWindow:self.sheetWindowController.window];
The sheetWindowController property's body is as follows. Note that
sheetWindowController is an instance variable.
if (sheetWindowController == nil)
{
sheetWindowController = [[SheetWindowController alloc] init];
if (editStudentWindowController == nil)
{
NSLog(@"Failed to load the nib file \"TheSheet\"");
}
}
return editStudentWindowController;
The init method for SheetWindowController loads the nib file with the
following code:
- (id)init
{
if ((self = [super initWithWindowNibName:@"TheSheet"]))
{
// TODO: Add code once this starts working!
}
return self;
}
The nib files seem to be wired up properly and the code seems to load
everything properly as the sheet does actually appear, just not
attached to the window.
If someone could point out my error or advise me to more advanced
debugging techniques to find the error, I would greatly appreciate it.
Thanks in advance,
Brian
_______________________________________________
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