• 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
Re: implementing pop up menus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: implementing pop up menus
      • From: James McCartney <email@hidden>
References: 
 >Re: implementing pop up menus (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: implementing pop up menus
  • Next by Date: Get IP address and info from FileHandle
  • Previous by thread: Re: implementing pop up menus
  • Next by thread: Re: implementing pop up menus
  • Index(es):
    • Date
    • Thread