Re: implementing pop up menus
Re: implementing pop up menus
- Subject: Re: implementing pop up menus
- From: Jim Correia <email@hidden>
- Date: Sat, 18 Jan 2003 14:00:33 -0500
On Saturday, January 18, 2003, at 01:46 PM, Shaun Wexler wrote:
On Saturday, January 18, 2003, at 10:24 AM, James McCartney wrote:
popUpContextMenu:withEvent:forView:
That's not the problem. I have a menu and it is popping up. The
problem is that with popUpContextMenu:withEvent:forView: the menu is
not aligned where I want it and it does not pop up selecting the menu
item that I want.
Can't you pre-select the MenuItem, and modify the mouse location in
the event, before passing the objects to the popUp method?
The big problem here is the underlying implementation has semantic
differences. The menus are implemented by the carbon menu manager.
popUpContextMenu... ends up calling ContextualMenuSelect which can load
context menu plugins and append them to your menu. The popup button
cell calls PopUpMenuSelect (which incidentally lets you set the initial
item.)
If it is important to you file a bug requesting a convenience method on
NSMenu that does the PopUpMenuSelect implementation underneath. You can
hack it up now making a temporary NSPopUpButtonCell, but you'll have to
make some assumptions that may not be futureproof.
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.