On Sep 23, 2010, at 7:54 AM, Jonathan Dann wrote:

> In our app, Kaleidoscope, I have 2 text views side-by-side. In one 
> configuration the layout of the text in each text view is dependent both on 
> regions of layout in the "sibling" text view, and the model objects which 
> represent the the insert, equal and deleted regions of the diff.
> 
> The problem I've had to continuously hack around is that NSTextView, in 
> conjunction with NSLayoutManager, is rather eager to get the text to 
> re-layout. For example, when I resize the window and need to adjust the 
> frames of both scroll views, calling -[NSTextView setFrame:] results in the 
> layout manager invalidating and ensuring layout for the newly visible 
> character range.
> 
> I'd like to know if anybody has had any experience/luck with completely 
> disabling the automatic layout that the text system does in response to these 
> changes in state?

You can look at the source to TextEdit for an example of removing the layout 
manager(s) from the text storage and then re-adding them, to prevent layout 
from occurring for a certain period.  This would probably not be appropriate if 
you want to retain any layout information across this transition, but if all 
the text needs to be laid out again anyway, it could be useful.

Douglas Davidson_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to