Re: Different NSCells in one NSTableView/NSTableColumn
Re: Different NSCells in one NSTableView/NSTableColumn
- Subject: Re: Different NSCells in one NSTableView/NSTableColumn
- From: glenn andreas <email@hidden>
- Date: Mon, 16 May 2005 15:45:43 -0500
On May 16, 2005, at 3:25 PM, Felix Schwarz wrote:
Hi everybody,
I need to have different NSCells (NSPopUpCell, NSComboBoxCell,
NSButtonCell, NSTextFieldCell) in one column on a per-row basis.
Much like when you click on the project in XCode, click "Get info",
choose the "Styles" tab and then have different kind of cells for
the compiler and linker settings.
Problem is, I don't find any information or sample code on how to
do this. I tried to exchange the NSCell of the NSTableColumn in the
tableView:willDisplayCell:forTableColumn:row:
and
tableView:objectValueForTableColumn:row:
delegate calls, but both results in or more or less unusable /
"corrupt" display of my data.
Any help would be greatly appreciated!
It's kind of subtle how these two interact with an NSTableView since
the place that it seems like it will be the most useful to handle
this is actually too late to matter!
tableView:willDisplayCell:forTableColumn:row: really is a way to tell
your delegate that "hey, I'm about to draw _this_ cell" and as a
result, you can only make changes to that given cell (which would let
you do things like change the style of a button, but not change the
class of the cell itself).
Instead, in your tableView:objectValueForTableColumn:row: routine,
you can call [tableColumn setDataCell: appropriateCell] and then
return an id of a value that is appropriate to that cell (so a check
box would have [NSNumber numberWithBool: onOrOff] - you can always
explicitly set things like the check box title and state as well)
Glenn Andreas email@hidden
<http://www.gandreas.com/> oh my!
quadrium | build, mutate, evolve | images, textures, backgrounds, art
_______________________________________________
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