• 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 Oddities
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSPopupButtonCell Oddities (From: Daniel Todd Currie <email@hidden>)

  • Prev by Date: Re: programmatically drawing an NSImageView in an NSView subclass
  • Next by Date: Spell-checking service
  • Previous by thread: NSPopupButtonCell Oddities
  • Next by thread: Re: Thinking about shareware prices...
  • Index(es):
    • Date
    • Thread