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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to