Re: Subclassing NSWindowController
Re: Subclassing NSWindowController
- Subject: Re: Subclassing NSWindowController
- From: Chaffinch <email@hidden>
- Date: Mon, 9 Dec 2002 13:30:38 +0000 (GMT)
--- Mike Ferris <email@hidden> wrote:
>
Here's one possible implementation strategy:
>
>
- document has-a NSTextStorage
>
- init method of your document creates an NSTextStorage
>
- load or read method of your document loads or reads into the
>
NSTextStorage
>
- window controller has-a
>
NSTextView-NSTextContainer-NSLayoutManager chain of objects (but no
>
NSTextStorage).
>
- window controller creates these objects programmatically, probably
>
- window controller's setDocument: makes sure the NSLayoutManager
>
gets connected to the NSTextStorage of the new document (using
>
NSTextStorage's addLayoutManager:).
Thanks to Mike and everyone else who offered suggestions to me on this topic.
I modified my code and got the original design working great.
However, I am interested in the points raised about using an NSTextStorage
and keeping the model and view seperate. Therefore I am no reimplementing my
code to use the NSTextView-NSTextContainer-NSLayoutManager chain of objects
mentioned by Mike.
But I have one more question, the Cocoa docs have an article titled
"Assembling the Text System by Hand" which shows how to create the
TextStorage, Container and LayoutManager. Is this the procedire I should
follow or am I over complicating things.
Regards
=====
Regards
Chaffinch
----------------------------------------------
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
_______________________________________________
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.