Programmatically show NSPopUpButton menu?
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