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: Peter Sichel <email@hidden>
- Date: Tue, 25 Sep 2001 12:04:40 -0400
Continuing the experiment, I found a work around:
- (IBAction)showWindow:(id)sender
{
NSArray *windowList;
int count, i;
NSWindow *theWindow;
pingWindowController = [[PingWindowController alloc] init];
if (pingWindowController) {
[[pingWindowController window] makeKeyAndOrderFront:self];
windowList = [NSApp windows];
count = [windowList count];
for (i=count-1; i>=0; i--) {
theWindow = [windowList objectAtIndex:i];
if ([[theWindow title] isEqualToString:@"Ping"]) {
[theWindow makeKeyAndOrderFront:self];
break;
}
}
}
}
Mystery question:
Why does the first makeKeyAndOrderFront display the window
but fail to make it key, while the second one that gets "theWindow"
from the NSApp window list succeed?
- Peter
--