Multi-window document app: How to only show the "main window" when opening
Multi-window document app: How to only show the "main window" when opening
- Subject: Multi-window document app: How to only show the "main window" when opening
- From: Markus Spoettl <email@hidden>
- Date: Tue, 13 May 2008 23:13:26 -0700
Hello,
I have an NSDocument based application with multiple
NSWindowControllers that visualize different aspects of the document.
One is the "main" view and this is the only one that should be visible
by default. The question is how does one do that?
When I create all window controllers in
MyDocument:makeWindowControllers: all contained windows become visible
immediately.
I've tried moving the creation of secondary NSWindowControllers out of
makeWindowControllers: to the point where they're first needed (an
IBAction message) using this code:
if (!trackView) {
trackView = [[TrackViewController alloc]
initWithWindowNibName:@"TrackView"];
[[self document] addWindowController:trackView]; // self is
the main NSWindowController
[trackView setShouldCloseDocument:NO];
}
// make trackView show/hide windows now
but for reasons I don't understand the window will never show up. The
nib doesn't seem to get loaded - at least
TrackViewController:awakeFromNib: is never called. Thus I thought
window controllers in a document based app may have to be created
within MyDocument:makeWindowControllers:. Sounds wrong to me but what
do I know.
If so, how can I hide the "secondary" windows by default (note that
"Visible at launch" is switched off in IB for all windows in the
application). Or alternatively defer the creation of secondary
NSWindowControllers?
Any insight would be much appreciated!
I'm using Xcode 3.0 on 10.5.2
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden