• 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
NSTableView with NSPopupButtonCell and long menu -- how to scroll to selected item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView with NSPopupButtonCell and long menu -- how to scroll to selected item


  • Subject: NSTableView with NSPopupButtonCell and long menu -- how to scroll to selected item
  • From: Glenn Zelniker <email@hidden>
  • Date: Mon, 18 Sep 2006 01:47:55 -0400

I have a table with a popup button as a data cell and there are many, many items (as many as 256) in the popup button's associated menu. I'd like the menu to scroll to the selected item in the menu when the user clicks the menu, but I can't quite figure out how to do it. I'm using numberOfItemsInMenu and menu:UpdateItem:atIndex:shouldCancel to populate the menu and this works fine. But I can't figure out the right point in the process of populating the menu that I should invoke -selectItemAtIndex on the popup button that "owns" the menu.

I've set up a handler for NSPopUpButtonCellWillPopUpNotification, but this notification seems to get called before the menu gets populated and I get an exception when I try to select the desired item in the menu. I've looked at using NSMenuDidAddItemNotification but it's a bit of a pain doing it this way. Is there perhaps a notification that gets posted when the menu is finished being populated? Or is there a better way to go about what I'm trying to do?

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Using WebKit to display data that's not in HTML
  • Next by Date: Is it archiving/unarchiving NSBezierPath object to disk a performance issue?.
  • Previous by thread: Re: Using WebKit to display data that's not in HTML
  • Next by thread: Is it archiving/unarchiving NSBezierPath object to disk a performance issue?.
  • Index(es):
    • Date
    • Thread