Document with more than one window
Document with more than one window
- Subject: Document with more than one window
- From: Christian Schneider <email@hidden>
- Date: Tue, 22 Feb 2005 14:57:27 +0100
Hi list,
I have a document with at least two views on the data, one table view
and one with custom drawing.
So, being a brave Cocoa citizen I implemented a subclass of
NSWindowController for each of the views and instantiate them in
makeWindowControllers. When doing this, both windows will open up when
a new document is opened.
The problem is that I do not necessarily wish to always open both
views and it will be the user's choice which views should be opened.
So one question is how might I do that. As far as I can see, there is
no way of instantiating a window controller without it opening its
window (even if "visible at launch time" is not selected in the nib).
That's not too bad, I can instantiate a controller later - when it's
needed. But where?
I'd like to keep all my views on the same level that is there's no
main controller. My documents are created by another controller that
also has a nib containing a menu. I use that menu to call an IBAction
on the active document via first responder so I figured I could use
that to open new windows as well.
However, while I can use the built-in action "play:" for the other
functionality there's no action I could connect to that somehow fits
the bill for the "open window" functionality. I've tried to add new
actions to first responder in the nib - which seemed to work - but the
menu items end up greyed out so it doesn't :-( . What's the right way
to use a menu to call actions on a document?
While the documentation tells me what to do should my document need
more than one window but I couldn't find any examples that actually
use more than one window controller. Any pointers?
Best regards
chris
_______________________________________________
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