• 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
Re: Sheet Doesn't Attach Itself To Window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sheet Doesn't Attach Itself To Window


  • Subject: Re: Sheet Doesn't Attach Itself To Window
  • From: "Brian T. Kelley" <email@hidden>
  • Date: Wed, 28 Nov 2007 16:16:38 -0500

Hello all,

I have some new information that may be relevant. Now that I've removed the runModalForWindow: method, I can display the sheet after it has been dismissed. When I initially display the sheet, it is still not attached to the window and still not modal for the window. However, on subsequent shows its works properly. Any ideas on why the first run doesn't work correctly?

Thanks in advance,
Brian

On Nov 28, 2007, at 2:53 PM, Brian T. Kelley wrote:

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 (sheetWindowController == 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

_______________________________________________

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


References: 
 >Sheet Doesn't Attach Itself To Window (From: "Brian T. Kelley" <email@hidden>)

  • Prev by Date: Re: Refresh problem with right aligned rectangle while resizing anNSOutlineView
  • Next by Date: Re: Refresh problem with right aligned rectangle while resizing anNSOutlineView
  • Previous by thread: Re: Sheet Doesn't Attach Itself To Window
  • Next by thread: Crash drawing a textfield?
  • Index(es):
    • Date
    • Thread