Re: Loading a nib window and making it key
Re: Loading a nib window and making it key
- Subject: Re: Loading a nib window and making it key
- From: David Rehring <email@hidden>
- Date: Mon, 24 Sep 2001 11:27:09 -0700
>
I've subclassed NSWindowController and include the following init
>
>
self = [super initWithWindowNibName:@"Ping"];
>
>
From the caller I do
>
>
pingWindowController = [[PingWindowController alloc] init];
>
if (pingWindowController) {
>
[pingWindowController showWindow:sender];
Try inserting [pingWindowController makeKeyAndOrderFront];
(well, with the correct parameter list)
>
if (![[pingWindowController window] isKeyWindow]) NSLog(@"Not
>
key window!");
>
}
>
>
The window appears but is not made the key window until
>
I click in it, or select the corresponding name
>
from the Window menu.
If you did it before the 'showWindow', it's possible that the window either
hasn't actually be instantiated [you can load the .nib with the window
closed and it won't necessarily be instantiated] or that
makeKeyAndOrderFront is defined to do nothing if the window isn't on-screen.
Later,
--
David Rehring Psychos do not explode when light hits
Senior Software Engineer them, no matter how crazy they are...
Atimi Software, Inc.
www.atimi.com And totally insane guy!