NSPopUpButtonCell?
NSPopUpButtonCell?
- Subject: NSPopUpButtonCell?
- From: David Sledge <email@hidden>
- Date: Tue, 11 Nov 2003 15:15:31 -0500
I have an NSTableView with 5 columns and the fifth column is a
NSPopUpButtonCell. I can add Items to it and they display in the
NSTableView. I am then changing the selected item of the NSPopUpButtonCell
in code based off of the data for that item. The log shows that the right
popup item is truly selected but how do I get the NSPopUpButtonCell to
display it?
Here is my example:
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
NSString *identifier = [aTableColumn identifier];
MyItem *item = [itemArray objectAtIndex:rowIndex];
if ([identifier isEqual:@"colActive"]) {
[[aTableColumn dataCellForRow:rowIndex]
addItemWithTitle:@"Active"];
[[aTableColumn dataCellForRow:rowIndex]
addItemWithTitle:@"Standby"];
if ([[item itemActive] isEqual:@"Active"]) {
[[aTableColumn dataCellForRow:rowIndex]
selectItemWithTitle:@"Active"];
NSLog(@"Selected Item: %@", [[aTableColumn
dataCellForRow:rowIndex]
selectedItem]);
} else {
[[aTableColumn dataCellForRow:rowIndex]
selectItemWithTitle:@"Standby"];
NSLog(@"Selected Item: %@", [[aTableColumn
dataCellForRow:rowIndex]
selectedItem]);
}
[[aTableColumn dataCellForRow:rowIndex]
synchronizeTitleAndSelectedItem];
}
return [task valueForKey:identifier];
}
_______________________________________________
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.