• 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
NSPopUpButton pullsDown:YES and dummy first item - normal?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPopUpButton pullsDown:YES and dummy first item - normal?


  • Subject: NSPopUpButton pullsDown:YES and dummy first item - normal?
  • From: Rua Haszard Morris <email@hidden>
  • Date: Thu, 2 Apr 2009 14:55:29 +1300

I am using a pull-down NSPopUpButton for a little button which displays a little menu. The menu has some commands in it, i.e. it's not a selection menu, the title of the button just displays an icon, no title, no indication of a current item from the menu. I am calling (ahem, sending) setUsesItemFromMenu:NO on (to) the cell.

It appears that with pull-down menus I need to insert a dummy item at index zero as my NSPopUpButton as a placeholder, and that NSPopUpButton/Cell (when in pull-down mode) will handily ignore this item.

This seems like a weird hack, and makes me think I'm going about this the wrong way - is this a normal approach?

The documentation mentions that the index of the first item in a pull- down should be 1, but it doesn't explain that you need to add a dummy item (for the zeroth) or else your first item will go missing.

thanks
Rua HM.
_______________________________________________

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: NSPopUpButton pullsDown:YES and dummy first item - normal?
      • From: Graham Cox <email@hidden>
    • Re: NSPopUpButton pullsDown:YES and dummy first item - normal?
      • From: Michael Ash <email@hidden>
  • Prev by Date: Re: Looking for [NSNumber numberWithString:]
  • Next by Date: Obj-C equivalent to Python generator functions
  • Previous by thread: Re: Looking for [NSNumber numberWithString:]
  • Next by thread: Re: NSPopUpButton pullsDown:YES and dummy first item - normal?
  • Index(es):
    • Date
    • Thread