NSWindowControllers and document-based app.
NSWindowControllers and document-based app.
- Subject: NSWindowControllers and document-based app.
- From: Raphael Sebbe <email@hidden>
- Date: Sun, 1 Jul 2001 18:10:33 +0200
Hi,
I am in the process of moving an application of mine to the Cocoa
doc-based paradigms.
So far I have a working implementation of that; it comes as a standard
one-window-per-document and many secondary windows (panels) that serve
to edit the "current" document. But now, I want to have secondary
document-windows, ie windows whose associated document becomes "current"
when they become "main".
The way I have been doing this is to create an NSWindowController by
passing it a window (from a nib), add that windowController to the
document (using addWindowController:) and invoke NSWindowController's
-showWindow: method. The window shows up correctly, but the titlebar
stays transparent and the window never becomes "main". This is a problem
because my secondary panels won't be editing the correct document if
that window does not become main.
Perhaps all the window controllers must be created from the overridden
NSDocument's makeWindowControllers; but this is not possible in my
particular case because the application user can create as much
secondary doc-window as he wants. Or perhaps I am doing something wrong ?
Thanks,
Raphael