NSView scrolling (NSTextView)
NSView scrolling (NSTextView)
- Subject: NSView scrolling (NSTextView)
- From: Anthony Duer <email@hidden>
- Date: Fri, 29 Apr 2005 20:26:36 -0700
Hey List,
I'm currently using a subclassed NSTextView to do some custom text
work. I'm, namely, creating a lot of NSMutableAttributedStrings and
highlighting particular words various colors. The text is being read
off of a separate socket and passed to the main thread as individual
lines via -performSelectorOnMainThread: object: wait:. The object takes
that, does some processing, and appends it to the view's text storage.
This goes particularly smoothly and it works.
However, I've noticed via Sampler (I'm on 10.2) that what I had thought
was slowing things down, namely Glyph generation, isn't the culprit.
Rather, it's NSClipView's scrollToPoint: function which is taking up
around half of the sampled calls. I'm able to view this directly as
scrolling up in the view and keeping it there (I've subclassed so that
it doesn't snap to the bottom when receiving new text) causes things to
go much faster. Namely, a process that takes 7-9 seconds to complete if
I'm watching it go by takes 2-3 seconds if I don't watch it and hit
'end' once the scroll bar stops moving (Which is fairly fast and
further supports that glyph generation isn't the problem).
Any help is appreciated. :)
~Anthony Duer
_______________________________________________
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