• 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: NSPopupUpButton not showing checked menu items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPopupUpButton not showing checked menu items


  • Subject: Re: NSPopupUpButton not showing checked menu items
  • From: Steve Christensen <email@hidden>
  • Date: Sun, 23 Nov 2008 15:33:12 -0800

On Nov 23, 2008, at 3:05 PM, Kyle Sluder wrote:

On Sun, Nov 23, 2008 at 6:01 PM, Steve Christensen <email@hidden> wrote:
The class methods also don't make a distinction between popup and pulldown,
so I would think that the "selection" should still be marked in the menu
when it's visible. I'm not trying to be argumentative, just wondering if I
have, in fact, made a good or bad assumption about behavior given how every
other menu I've seen works. I suppose I could manually set the individual
menu item states but that seems like work I shouldn't need to do.

I think you have made a bad assumption. The selection bindings for NSPopupButton consist of selectedIndex, selectedObject, selectedTag, and selectedValue. In order to support multiple selected items, NSPopupButton would need a selectionIndexes binding.

Actually, I only wanted to select a single item in the pulldown case, the same as what correctly happens for me in the popup case. The problem has always been that, even though the button itself is reporting that a particular item is "selected," none of the underlying NSMenuItems' state is ever set to anything other than where it was left in IB (which is typically NSOffState). And so a check mark is never set next to the most-recently selected menu item.


I'd suggest filing an enhancement request, describing what you want to do
and asking that the selection bindings either be documented to return the
first selected item in the case of multiple selected items, or that
NSPopupButton expose a selectionIndexes binding.

No enhancement request needed. I'm seeing apparently inconsistent behavior between the popup and pulldown cases. I'm certainly willing to concede that I've goofed someplace, but if so it's not at all obvious (and thus the questions). :)


steve

_______________________________________________

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: NSPopupUpButton not showing checked menu items
      • From: Peter Ammon <email@hidden>
    • Re: NSPopupUpButton not showing checked menu items
      • From: Benjamin Dobson <email@hidden>
References: 
 >NSPopupUpButton not showing checked menu items (From: Steve Christensen <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: Steve Christensen <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: "Kyle Sluder" <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: Steve Christensen <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: "Kyle Sluder" <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: "Kyle Sluder" <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: Steve Christensen <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: "Kyle Sluder" <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: Steve Christensen <email@hidden>)
 >Re: NSPopupUpButton not showing checked menu items (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: NSTableView Problems
  • Next by Date: Re: NSTableView Problems
  • Previous by thread: Re: NSPopupUpButton not showing checked menu items
  • Next by thread: Re: NSPopupUpButton not showing checked menu items
  • Index(es):
    • Date
    • Thread