• 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
NSTextView Bad Behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView Bad Behavior


  • Subject: NSTextView Bad Behavior
  • From: Gordon Apple <email@hidden>
  • Date: Mon, 14 Dec 2009 12:50:47 -0600
  • Thread-topic: NSTextView Bad Behavior

Apparently, I'm not the only one who has experienced this.  NSTextView (or
NSLayoutManager) is lazy.  It does stuff in the background that is driving
me nuts.  I need to do a full layout, not just what's visible, so I can get
a reliably accurate measure of the total physical text layout length.  I've
tried the usual suspects such as scrollRangeToVisible and the
docs-recommended glyphRangeForTextContainer, all to no avail, in an attempt
to get an immediate full layout.  I've even put in timer delays before
measuring it.  Unfortunately, NSTextView comes back into play sometime later
and does a re-layout, often increasing the text frame height by as much as
50%, totally screwing up what I am doing. Manually scrolling to the end and
back will trigger another (correct) layout.  However, because I'm often
(programmatically) replacing the displayed text, I need to accomplish this
programmatically before asking for the text frame height.

Any ideas on how to force a full layout and then prevent NSTextView from
further mucking with it?


_______________________________________________

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: NSTextView Bad Behavior
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: memcpy with 64 bit
  • Next by Date: Re: NSTextView Bad Behavior
  • Previous by thread: Re: memcpy with 64 bit
  • Next by thread: Re: NSTextView Bad Behavior
  • Index(es):
    • Date
    • Thread