Re: NSTextView replaceCharactersInRange performance and thread safety
Re: NSTextView replaceCharactersInRange performance and thread safety
- Subject: Re: NSTextView replaceCharactersInRange performance and thread safety
- From: Douglas Davidson <email@hidden>
- Date: Tue, 4 Jan 2005 12:39:01 -0800
On Jan 4, 2005, at 12:31 PM, David Kocher wrote:
Thanks for the response! Indeed this seems to improve the
performance; I was calling setFont: as the NSTextView reverts back
the default Helvetica font if inserting a non-attributed string; I
suppose this to be a bug.
A missing value for NSFontAttributeName gives you the default font.
There are similar defaults for other attributes; see
<AppKit/NSAttributedString.h> for details.
Frequent call to scrollRangeToVisible: still freezes/blocks the main
thread (getting the spinning ball). I am however not sure if
scrollRangeToVisible: can be called from another thread (I assume the
appkit is not thread safe in general) - there doesn't seem to be much
documentation on this topic.
Many portions of the AppKit are threadsafe, but layout in a particular
text view/layout manager/text storage combo is not. You can scroll
quickly to a particular point in the text view, but the problem is that
until layout is finished you do not know how large the text view is so
as to scroll to the end. One possibility would be to to install a
delegate on the layout manager to be notified when layout is complete,
and scroll then.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden