Re: NSTextView, partial views of NSTextStorage
Re: NSTextView, partial views of NSTextStorage
- Subject: Re: NSTextView, partial views of NSTextStorage
- From: Martin Wierschin <email@hidden>
- Date: Fri, 14 Sep 2007 16:51:03 -0700
Hi Jesse,
1. First is it possible to subclass or tell NSLayoutManger to only
work with a specific range and just layout that range in it's
associated NSTextStorage?
This definitely isn't possible with the current public
NSLayoutManager API. I've never tried anything like you want, but if
you did dig into the private methods, I bet it would be a huge effort
(or impossible) and much frustration. All the NSTextStorage APIs you
need are public, so I'd stick with what you have.
2. Or if the above isn't possible is it possible to tell a
NSTextView to just draw and edit a subrange of it's text and ignore
the rest?
What you want isn't directly possible, but you could always construct
a series of NSTextContainers to accomplish what you like. Basically
you would just assign the NSTextView the container for the Nth
paragraph associated with your single NSLayoutManager. The trick is
you'd need to have a way to break your content up logically into
these containers. I can think of two options:
1. Have your NSTextStorage play along by maintaining a series of
artificial container/page breaks in the text stream wherever you want
to separate your content into another view.
2. Resize your NSTextContainers to exactly fit the content they need
to show. This doesn't sound appealing, since you'd have to resize
each container as each edit/layout cycle finishes.
~Martin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden