• 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: Cocoa Text System - Temporarily Disabling Layout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Text System - Temporarily Disabling Layout


  • Subject: Re: Cocoa Text System - Temporarily Disabling Layout
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 24 Sep 2010 16:23:42 -0700

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 (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

  • Follow-Ups:
    • Re: Cocoa Text System - Temporarily Disabling Layout
      • From: Jonathan Dann <email@hidden>
References: 
 >Cocoa Text System - Temporarily Disabling Layout (From: Jonathan Dann <email@hidden>)

  • Prev by Date: How do you remove an item from recentDocumentURLs?
  • Next by Date: What would cause my animation's delegate methods to not be called?
  • Previous by thread: Re: Cocoa Text System - Temporarily Disabling Layout
  • Next by thread: Re: Cocoa Text System - Temporarily Disabling Layout
  • Index(es):
    • Date
    • Thread