NSTableView and NSPopUpButton
NSTableView and NSPopUpButton
- Subject: NSTableView and NSPopUpButton
- From: Chris Campbell <email@hidden>
- Date: Sat, 8 Nov 2003 23:39:14 -0600
I have a tableview with a column of popupbuttons. I want each
popupbutton to have it's own unique list of items. I must be missing
something because all the popupbuttons are using the default.
Heres the relevant bits of code (please excuse the pseudo-code):
-(void)awakeFromNib
[[[[myTableColumn tableColumns] objectAtIndex:1] dataCell]
addItemsWithTitles:
[NSArray arrayWithObjects:@"Default",@"other default",@"last
default",nil]];
-(void)initializeData
for(....)
NSPopUpButton* button = [[NSPopUpButton alloc] init];
[button addItemWithTitle:@"Individual Pop Up List..."];
[button selectItemAtIndex:0];
[buttonList addObject:button];
endfor
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
if( aTableColumn == buttonColumn)
return [buttonList objectAtIndex:rowIndex];
_______________________________________________
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.