Re: row bg color in NSOutlineView
Re: row bg color in NSOutlineView
- Subject: Re: row bg color in NSOutlineView
- From: jgo <email@hidden>
- Date: Sun, 23 Dec 2001 19:40:32 -0800
>
Itrat Khan 2001-12-22 05:06:22 -0500
>
> On Saturday, 2001 December 22 at 01:29, jgo wrote:
>
>> John C. Randolph 2001-12-21 04:22:20 -0800
>
>> 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, the current scheme, as I read the docs, would have 5 cells,
each of which could get changed 1000 times, whenever the entire
table is updated (under the scenario). Hopefully, in practice,
it would only go to the data source for the cells that fit on
screen, which it would only know by checking as it goes.
>
> 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.).
Yes, I understand that they think they've traded processing
time to save storage, but the information gets stored either
way; either in the 2 dimensional array of NSCells if the
NSTableView had been set up that way, or in the 2 dimensional
array of objects the individual developers will need for the
implementation (providing both the glyphs and the characteristics
of it, and the characteristics that apply to the rectangle in
which it is to be drawn).
It's been brought up before & is not a huge deal; I can
understand how someone might make such a choice. It's just
another of those non-intuitive quirks. But it's OK for a
first pass... as long as something better is coming down
the road a short piece.
(Besides which, I couldn't pass up the chance to give the soon
to be new Apple guy a token hard time.)
John G. Otto, Eagle Scout, Knight, Cybernetic Praxeologist
Existence, Consciousness, Identity, Life, Liberty, Property, Privacy, Justice