NSTable Column Issues
NSTable Column Issues
- Subject: NSTable Column Issues
- From: Roberto Arias <email@hidden>
- Date: Tue, 5 Apr 2005 18:31:08 +0100
Hi,
Is it possible to use a tableColumn with a NSPopUpButtonCell and set
different data sources for every popup in the column?
I've tried using the delegate method
- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn row:(int)row
{
SString * identifier = [tableColumn identifier];
if ([identifier isEqualToString:@"subgenre"]) {
if (row == 2) {
[cell addItemWithTitle:@"sabor"];
}
}
}// its a dummy example, just to try the delegate behavior.
And it changes all rows from row #2, instead of changing just row #2...
May be subclassing NSTableColumn is the way to go? If so, does anybody
has an example, or something? I think I would need to override
dataCellByRow, but I'm not sure how to do it.
By the way, what Im trying to do is to change the contents of the
popup in the column #3, based on the selection of the column #2 (which
is also a popup). Something like:
Title | Category 1 | Category 2 | ...
title | movie | terror | ...
title 2 | song | disco | ...
So, when 'movie' is selected, the popup Category 2 shows 'terror',
'drama', 'comedy', etc.
May be my approach is completly wrong?
_______________________________________________
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