Re: NSTextView, partial views of NSTextStorage
Re: NSTextView, partial views of NSTextStorage
- Subject: Re: NSTextView, partial views of NSTextStorage
- From: Jesse Grosjean <email@hidden>
- Date: Fri, 14 Sep 2007 20:12:03 -0400
Martin,
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.
Thanks for your responses. My reading of the api came up with similar
conclusions, I was just hoping that I was missing something and that
there was a cleaner way.
Thanks,
Jesse
_______________________________________________
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