Re: NSWindowController confusion redux
Re: NSWindowController confusion redux
- Subject: Re: NSWindowController confusion redux
- From: Ken Tozier <email@hidden>
- Date: Tue, 23 May 2006 00:11:05 -0400
On May 22, 2006, at 4:14 AM, mmalcolm crawford wrote:
On May 22, 2006, at 1:02 AM, Ken Tozier wrote:
mainPaletteController = [[NSWindowController alloc]
initWithWindowNibName: @"MainPalette" owner: self];
mainPaletteController = [[NSWindowController alloc]
initWithWindowNibName: @"MainPalette"];
Thanks mmalc, but alas, no. Still getting a null window.
Running this:
mainPaletteController = [[NSWindowController alloc]
initWithWindowNibName: @"MainPalette"];
[mainPaletteController showWindow: self];
NSLog(@"window = %@", [mainPaletteController window]);
(No window appears on screen)
NSLog output:
2006-05-22 23:49:35.932 QuarkXPress[23268] -[NSWindowController
loadWindow]: failed to load window nib file 'MainPalette'.
2006-05-22 23:49:35.933 QuarkXPress[23268] window = (null)
Running this:
mainPaletteController = [[NSWindowController alloc]
initWithWindowNibName: @"MainPalette" owner: self];
[mainPaletteController showWindow: self];
NSLog(@"window = %@", [mainPaletteController window]);
(Window appears on screen)
NSLog output:
2006-05-22 23:55:18.749 QuarkXPress[23302] window = (null)
So it looks like the "owner" field is mandatory, at least in my case.
I guess I don't understand how a window can exist on screen and
behave normally at least as far as layer switching/moving around the
screen goes if nothing owns or has access to it. What could possibly
be the owner if not the window controller? Who's retaining it? I'm
not doing anything especially tricky here. Just open the window and I
want to hide it or show it in response to a menu command. Those
three lines are it as far as creation/initialization goes.
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden