I have a program, that displays the contents of a csv file (soon to also allow mysql). First I just had it displaying the data, but then I went and added an NSPopUpButtonCell, at the top of each row with the delegate method:
When I added that, the first column takes up the entire row, no matter what size the row, or the columns, it expands to the entire table, covering the other columns. all the columns are probably the same size (they all have the pop up) but are being covered by the first column.
Code:
- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex {
if(rowIndex == 0) {
NSPopUpButtonCell *cell = [[[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO] autorelease];
[cell setEditable:YES]; [cell setBordered:NO];
[cell addItemsWithTitles:[NSArray arrayWithObjects:@"Data", @"Start X", @"Start Y", @"Start Z", @"End X", @"End Y", @"End Z", @"Ignore", nil]];
return cell;
} else {
NSTextFieldCell *cell = [[[NSTextFieldCell alloc] initTextCell:@""] autorelease];
[cell setEditable:YES];
return cell;
}
}
When I added that, the first column takes up the entire row, no matter what size the row, or the columns, it expands to the entire table, covering the other columns. all the columns are probably the same size (they all have the pop up) but are being covered by the first column.