• 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: Loading a nib window and making it key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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!


  • Follow-Ups:
    • Re: Loading a nib window and making it key
      • From: Ondra Cada <email@hidden>
References: 
 >Loading a nib window and making it key (From: Peter Sichel <email@hidden>)

  • Prev by Date: Machine serial number
  • Next by Date: Re: Pascal and Cocoa
  • Previous by thread: Loading a nib window and making it key
  • Next by thread: Re: Loading a nib window and making it key
  • Index(es):
    • Date
    • Thread