• 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: Please help. At wit's end binding NSPopupButtonCell selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please help. At wit's end binding NSPopupButtonCell selection


  • Subject: Re: Please help. At wit's end binding NSPopupButtonCell selection
  • From: Cathy Shive <email@hidden>
  • Date: Tue, 4 Nov 2008 11:32:50 +0100

On Nov 4, 2008, at 10:05 AM, Ken Tozier wrote:

What happens is that when I choose an item in one row's popup cell, the selection in every popup in the entire table changes to the new selection.

Don't forget that there is only one NSPopUpButtonCell per column. If you change it's selection, it's actually correct that when the table redraws, the other rows will redraw to show the new selection.


Basically - If you have 5 rows, it appears that there are 5 different popup menus, but really, there is one that has been drawn 5 times at different locations.

The table view tells you when it's about to draw a cell and you can set the correct selection of your popup cell here. All you need to do is implement the delegate method:

- (BOOL)tableView:(NSTableView *)theTableView willDisplayCell: (id)theCell forTableColumn:(NSTableColumn*)theTableColumn row: (int)theRowIndex
{
if([[theTableColumn identifier] isEqualToString:@"MyPopUpButtonColumn"])
[theCell selectItemAtIndex:anIndex];
}



HTH, Cathy

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Please help. At wit's end binding NSPopupButtonCell selection
      • From: Ken Tozier <email@hidden>
References: 
 >Please help. At wit's end binding NSPopupButtonCell selection (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: NSTableView Informal Protocal
  • Next by Date: Do i need to call NSTreeController setContent: in awakeFromNib?
  • Previous by thread: Please help. At wit's end binding NSPopupButtonCell selection
  • Next by thread: Re: Please help. At wit's end binding NSPopupButtonCell selection
  • Index(es):
    • Date
    • Thread