• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Figuring out the way the document classes work together. Some questions.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Figuring out the way the document classes work together. Some questions.


  • Subject: Re: Figuring out the way the document classes work together. Some questions.
  • From: email@hidden
  • Date: Sun, 30 Jun 2002 10:27:25 -0500

Jose..

Although not an expert on this subject perhaps I can shed SOME insight from my learnings going thru
and creating a "semi-complex" document application..

1) Well, as you have surmised the "windowTitleForDocumentDisplayName" is only for document
type "windows".. I.e. those window controllers that are controlled by the application's NSDocumentController..
Normal windows do NOT get these "requests" because..they aren't associated with a document.. :-)

So.. If you really want to set the title of a non-document window you should simply either:
1) Set the appropriate title in IB if "static" or
2) use the Window's setTitle: NSString * method programatically ..

Also.. You made a point below that the NSDocumentController knows about ALL windows
for the app. That is incorrect. It only knows about DOCUMENTS that are open in the
program. The DOCUMENTS know about its associated window controllers, and the controllers
know about their window. (phew) .

Also, you must remember that a NSWindowController was sort of really created to handle
document windows.. however useful it maybe for other things. If called without a "document context"
than YOU will have to invoke the appropriate method calls. Or.. use a slightly different "controller"
paradigm for those windows that inheret from NSObject and are the delegate's for the associated
windows and override the NSWindow delegates, etc. etc. (NSView delegates, whatever the
non-document windows have) to get various pieces of functionality.

Hope this helps a bit..

-SJM



On Saturday, June 29, 2002, at 07:18 PM, Jose L. Hales-Garcia wrote:

My application opens two types of windows: document windows
and console windows.

The delegate for the console's nib objects is a NSWindowController
class. It encapsulates tasks, pipes and the input and output to the
window. All works except for one thingthe method I've defined
to override windowTitleForDocumentDisplayName is not called.
Which class calls this method? One of the three document
classes? The delegate class?

To complete the picture the delegate for the MainMenu nib is an NSObject
class. It creates instances of the window controllers for the various
windows. For example, the consoles are created with this method
by my MainMenu delegate:

- (IBAction)newConsoleWindow:(id)sender {

ConsoleController *console = [[ConsoleController alloc] init];
[console showWindow:self];
}

The console controllers are initialized like...

- (id)init {
self = [super initWithWindowNibName:@"Console"];
return self;
}

In studying the problem more questions about the way the document
classes work together come up, in particular when NSDocument is
taken out of the loop. NSDocumentController surely is aware of the
console windows that are created. Can I use NSDocumentController
to get information about the windows that exist? Or do I keep track of
quantity and types of windows independently? Are these simple
initializations of the console windows enough?

Jose
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Figuring out the way the document classes work together. Some questions. (From: "Jose L. Hales-Garcia" <email@hidden>)

  • Prev by Date: Re: Deleting contents of NSTextView...
  • Next by Date: Re: Selecting submenu root
  • Previous by thread: Figuring out the way the document classes work together. Some questions.
  • Next by thread: Valentina Example?
  • Index(es):
    • Date
    • Thread