Re: Problem with NSOutlineView outlineView:willDisplayCell:forTableColumn:item: delegate method
Re: Problem with NSOutlineView outlineView:willDisplayCell:forTableColumn:item: delegate method
- Subject: Re: Problem with NSOutlineView outlineView:willDisplayCell:forTableColumn:item: delegate method
- From: Tim Hewett <email@hidden>
- Date: Thu, 27 May 2004 08:17:07 +0100
Bill,
On 26 May 2004, at 22:23, email@hidden wrote:
I should have spelled this out a little more, adding this: Since the
delegate method is called on every cell that needs to be displayed,
your
implementation has to provide display information both for the cell
you do
want to reflect your custom formatting or whatever, and all cells that
you
do NOT want to be affected. Like, telling one cell to show red text
and all
the others to show black.
That's absolutely correct, and as you say, the method is only called for
one cell at a time and it is up to your code to setup the cell for the
specified row and column, be it the text colour, the state of a
checkbox,
or whatever. When the view wants to display the cell for another row
and column, your delegate will be called again for that row and column.
It is not for the delegate to try to handle multiple cells at once.
However if the outline view indicates it will display a cell for a row
and
column, and you setup the cell for that row and column, you would
expect the view then to display the cell in _that_ row and column when
you return from the delegate. Normally for me this works fine, but in
the scenario described where you click from a higher row to a lower
one, it doesn't, it all goes wrong like this:
Clicking (e.g.) row 20 when row 5 was the previous selected row:
1. willDisplayCell is called for row 5 column 0 (the table has just one
column), the cell is setup, the delegate returns, the outline view
should
display the cell in row 5 column 0, but instead displays it in row 20
column 0.
2. willDisplayCell is called for row 6 column 0, the cell is setup, the
delegate returns, the outline view should display the cell in row 6
column 0, but instead displays it in row 20 column 0.
3. willDisplayCell is called for row 7 column 0, the cell is setup, the
delegate returns, the outline view should display the cell in row 7
column 0, but instead displays it in row 20 column 0.
4. willDisplayCell is called for row 8 column 0, the cell is setup, the
delegate returns, the outline view should display the cell in row 8
column 0, but instead displays it in row 20 column 0.
....
20. willDisplayCell is called for row 20 column 0, the cell is setup,
the
delegate returns, and at last the outline view displays the cell in the
row it should be displayed in.
So that's the problem. In this specific circumstance, the outline view
says it will display the cells in one row, but repeatedly displays them
in another one. As far as I can see this is beyond the control of my
application...
Tim.
http://www.coolatoola.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.