Re: NSPopupButtonCell Oddities
Re: NSPopupButtonCell Oddities
- Subject: Re: NSPopupButtonCell Oddities
- From: p3consulting <email@hidden>
- Date: Tue, 13 Jan 2004 09:19:33 +0100
This is more a NSTableView problem than a NSPopupButton one
You should implement
- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
in your data source, the value object passed for a NSPopupButtonCell is
a NSNumber with the index of the selected item in the menu.
Pascal Pochet
P3 Consulting
On 9 janv. 2004, at 00:44, Daniel Todd Currie wrote:
>
I set an action for my NSPopupButtonCell like so:
>
>
> [[[targetTable tableColumnWithIdentifier:@"archive"] dataCell]
>
> setAction:@selector(archiveSelected)];
>
>
And implement -archiveSelected like so (for testing purposes):
>
>
> - (void)archiveSelected;
>
> {
>
> NSLog(@"%@", [[[targetTable tableColumnWithIdentifier:@"archive"]
>
> dataCell] titleOfSelectedItem]);
>
> }
>
>
The problem is that my NSLog always gives me the title of the item
>
that was previously selected before the action, not the one that was
>
just selected. What useless information this is...
>
>
Is there a better way to find out what menu item was just selected?
>
>
Fondly,
>
>
Daniel Currie
>
_______________________________________________
>
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.