• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSPopUpButtonCell?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: kqueue experiences or sample?
  • Next by Date: compiling problem (command line)
  • Previous by thread: Re: Pure newbie :(
  • Next by thread: Re: NSPopUpButtonCell?
  • Index(es):
    • Date
    • Thread