Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSView scrolling (NSTextView)



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.