Re: Loading a nib window and making it key - Mystery solved
Re: Loading a nib window and making it key - Mystery solved
- Subject: Re: Loading a nib window and making it key - Mystery solved
- From: Peter Sichel <email@hidden>
- Date: Fri, 12 Oct 2001 16:39:47 -0400
At 10:16 PM +0200 9/25/01, email@hidden wrote:
The same problem appends to me but... unfortunately I don't have the answer.
I work with cocoa-java and can't use makeKeyAndOrderFront properly.
The window is shown but is not the key. I try with an outlet,
without outlet and others solution but nothing works.
As some may recall, I was having trouble loading a nib window
and making it key. The window would load and display but fail
to become key. The value returned from [NSWindowController window]
was nil.
I found the problem. When you define a window in a separate nib
file, it is not enough to wire your WindowController instance
to the Window, you must wire the File's Owner instance
to the window (or at least the window outlet in the File's Owner).
The File's Owner is a proxy for the WindowController and must
be wired to the window. [I haven't found where this is
explained in "Learning Cocoa".]
Share and Enjoy,
- Peter
--