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