• 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
Programmatically show NSPopUpButton menu?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Programmatically show NSPopUpButton menu?


  • Subject: Programmatically show NSPopUpButton menu?
  • From: Keith Blount <email@hidden>
  • Date: Thu, 26 Oct 2006 13:46:46 -0700 (PDT)

Hello,

I would like to bring up the menu of an NSPopUpButton programmatically - ie. without the user having to click on the button itself. This may sound strange, but the popup button's menu controls different formatting aspects of a text view. The user brings up the menu and then hits a keyboard shortcut connected to the menu items in the popup button to change the formatting (the keyboard shortcuts are just single keys - "1", "2" etc - so the menu has to be presented before the user can use the shortcuts; my app has a gazillion keyboard shortcuts so this was the best way of doing this part).

I tried this:

- (void)showElementsMenu:(id)sender
{
    [[elementsPopup cell] attachPopUpWithFrame:[elementsPopup frame] inView:elementsPopup];
}

But to no avail - the popup button's menu does not get brought up.

Does anybody know how to do this?

Thanks in advance!
Keith



 _______________________________________________
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

  • Follow-Ups:
    • Re: Programmatically show NSPopUpButton menu?
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: outlets to multiple views (NSView)
  • Next by Date: Re: Newbie Problem with KVC compliance
  • Previous by thread: Re: Core Image performance
  • Next by thread: Re: Programmatically show NSPopUpButton menu?
  • Index(es):
    • Date
    • Thread