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: Ondra Cada <email@hidden>
- Date: Mon, 24 Sep 2001 22:00:31 +0200
David,
>
>>>>> David Rehring (DR) wrote at Mon, 24 Sep 2001 11:27:09 -0700:
DR> >pingWindowController = [[PingWindowController alloc] init];
DR> >if (pingWindowController) {
DR> >[pingWindowController showWindow:sender];
DR>
DR> Try inserting [pingWindowController makeKeyAndOrderFront];
DR> (well, with the correct parameter list)
nil or self or whatever -- an object, which is ignored.
I'm not sure though whether the window controller would forward the message
to the window correctly. Perhaps it would; if not, you want probably
"[[pingWindowController window] makeKeyAndOrderFront:self]".
DR> >if (![[pingWindowController window] isKeyWindow]) NSLog(@"Not
DR> >key window!");
DR> >}
DR> >
DR> >The window appears but is not made the key window until
DR> >I click in it, or select the corresponding name
DR> >from the Window menu.
DR>
DR> If you did it before the 'showWindow', it's possible that the window
DR> either hasn't actually be instantiated [you can load the .nib with the
DR> window closed and it won't necessarily be instantiated] or that
I don't think so.
DR> makeKeyAndOrderFront is defined to do nothing if the window isn't
DR> on-screen.
I don't think so.
I can't see where the real problem is (sorry -- that's why I haven't
answered the original mail), but I am pretty sure it won't be this: all
objects from a NIB _are_ instantiated one way or another, and
makeKeyAndOrderFront: _would_ bring an offscreen window to the screen.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc