Popping open a status item menu
Popping open a status item menu
- Subject: Popping open a status item menu
- From: Pierre Bernard <email@hidden>
- Date: Wed, 6 Feb 2008 17:47:11 +0100
Hi!
I would like to programmatically pop open the menu attached to a
NSStatusItem.
At first sight, NSStatusItem, provides the perfect API:
- (void)popUpStatusItemMenu:(NSMenu*)menu;
The result of this call however is not perfect: the menu open at exact
the right location. Yet the menu item in the menu bar is not
highlighted.
Thus this is only marginally better than opening the menu as a
contextual menu:
[NSMenu popUpContextMenu:[self statusMenu] withEvent:theEvent
forView:nil withFont:nil];
The stack trace leading to -viewDidMoveToWindow when accessing the
menu using the mouse, has this promising private method listed:
- [NSStatusBarButtonCell popupStatusBarMenu:inRect:ofView:withEvent:]
To call that I would need to figure out how to get to the
NSStatusBarButtonCell. Then I wonder what this method expects for a
NSRect.
TIA for suggestions, thoughts and hints.
Pierre
---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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