FROM : Jim Correia
DATE : Sat Jan 18 20:00:33 2003
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Sat Jan 18 20:00:33 2003
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| James McCartney | Jan 18, 08:46 | |
| mw | Jan 18, 14:32 | |
| James McCartney | Jan 18, 19:24 | |
| Shaun Wexler | Jan 18, 19:46 | |
| Jim Correia | Jan 18, 20:00 | |
| James McCartney | Jan 18, 23:12 |






Cocoa mail archive

