window won't become main or key programmatically
window won't become main or key programmatically
- Subject: window won't become main or key programmatically
- From: Ken Victor <email@hidden>
- Date: Thu, 29 Sep 2005 14:17:10 -0700
i have a multi-window (core data) document based cocoa app. one of my
windows is not associated with any document, ie, it is a "preference
like" window. this window is represented by a nib file. in response
to a user menu selection, i instantiate the window via (from within
my app delegate):
NSWindowController* wc = [[NSWindowController alloc]
initWithWindowNibName: @"prefLike" owner: self];
[[wc window] makeKeyAndOrderFront: self];
the window instantiates fine and displays fine. however, and although
it becomes the front window, it doesn't become the main or key
window. note however, that clicking on the window will make it main
and key without any problem.
i believe this may be because calling [wc window] returns nil, even
quite a while later after the window has been made front via a click.
i've set a breakpoint at [NSWindowController setWindow] and it is
being called.
so, what would cause this problem?
note that calling [wc showWindow] doesn't help.
on a related note, i do have "Visible at Launch Time" checked for the
window in IB. however, if i uncheck this, even calling [wc
showWindow] doesn't show the window.
i think i'm probably confused about something basic in all this, and
will appreciate any guidance.
thanx,
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden