• 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
Re: NSPopUpButtonCell?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPopUpButtonCell?


  • Subject: Re: NSPopUpButtonCell?
  • From: Stéphane Sudre <email@hidden>
  • Date: Tue, 11 Nov 2003 22:39:05 +0100

Don't do this in:

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex

but instead in:

- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(int)row


On mardi, novembre 11, 2003, at 09:15 PM, David Sledge wrote:

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.
_______________________________________________
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: Pure newbie :(
  • Next by Date: Re: Pure newbie :(
  • Previous by thread: NSPopUpButtonCell?
  • Next by thread: compiling problem (command line)
  • Index(es):
    • Date
    • Thread