Re: row bg color in NSOutlineView
Re: row bg color in NSOutlineView
- Subject: Re: row bg color in NSOutlineView
- From: "John C. Randolph" <email@hidden>
- Date: Sat, 22 Dec 2001 02:39:39 -0800
On Saturday, December 22, 2001, at 02:06 AM, Itrat Khan wrote:
>
On Saturday, December 22, 2001, at 01:29 AM, jgo wrote:
>
>
>> To save storage, NSTableView reuses cells to draw multiple items.
>
>
>
> Are they that massive? I thought that part of the idea of cells
>
> is that they're lighter than views.
>
>
They are lighter, but if you had 1,000 rows and five columns,
>
you'd need 5,000 instances instead of just one.
Well, an NSTableView would have five cells in this case, but
your point still holds.
>
> I don't quite get this. If one can set the cell for a specific
>
> point in the table (column & row), then it must not be getting
>
> re-used everywhere.
>
>
You don't actually set the cell, you're given the cell and you
>
can update its attributes (state, text colour, etc.).
Exactly. You're given the cell *and* the location it's about to
draw, so you can alter it accordingly.
-jcr
"I fear all we have done is to awaken a sleeping giant and fill
him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7,
1941.