Re: Slow horizontal scrolling w/NSMutableAttributedStrings
Re: Slow horizontal scrolling w/NSMutableAttributedStrings
- Subject: Re: Slow horizontal scrolling w/NSMutableAttributedStrings
- From: "John H. Lee" <email@hidden>
- Date: Tue, 24 May 2005 19:17:39 -0700
Thanks for your suggestion, Matt. I know this sounds like a terrible
interface, but the non-wrapping column/row setup is essential for
presenting this type of data: genetic sequences. The background
colors show correlations between individual characters (residues) on
different lines, so this really *is* just a huge matrix.
I'm playing around with drawing the background color rects myself,
abandoning attributed strings altogether. I'm hoping that drawing
only the visible/changed rects will speed things up. This is messy
and painful, so I hope someone out there has a more elegant solution!
-J
On May 24, 2005, at 6:58 PM, Matt Neuburg wrote:
On Tue, 24 May 2005 15:07:16 -0700, "John H. Lee"
<email@hidden>
said:
I'm building an app that contains a single NSTableView with one
column. My data source is an NSMutableArray of
NSMutableAttributedStrings. Each of these strings contains up to a
few thousand characters with about half of the characters having
background colors set.
Vertical scrolling is fine, but horizontal scrolling is very slow.
If I leave the strings unattributed, horizontal scrolling is much
faster. When scrolling vertically by one row, only that new row is
retrieved from my data source. Horizontal scrolling requires
retrieval of all visible rows (~30). The problem persists if I use
an NSTextView instead of NSTableView. All of this leads me to
believe that my data source is plenty efficient (just an [array
objectAtIndex:row]), so the problem must lie in the rendering of lots
o' attributed strings.
Any suggestions here?
Consider a different interface. Is it really necessary to display
strings "a
few thousand characters" in length in a horizontal non-wrapping
view? Why
require horizontal scrolling at all? This doesn't sound like a very
pleasant
way to read text; one is not accustomed to scrolling horizontally
again and
again in this manner. Why not show just the first few characters of
each
string, and use an inspector architecture so that when the user
clicks on a
row, the whole string shows up in some other piece of interface,
such as a
regular, old-fashioned, wrapping NSTextView? m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
--
John H. Lee
Berkeley Phylogenomics Group
http://phylogenomics.berkeley.edu
_______________________________________________
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