• 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: mw <email@hidden>
  • Date: Sat, 18 Jan 2003 08:32:00 -0500

On 1/18/03 2:46 AM, "James McCartney" <email@hidden> wrote:

> OK I've got an NSView subclass that contains widgets that are not
> NSViews. I want to have a mouse click in certain locations pop up a
> menu selection. I can do that using
> NSMenu popUpContextMenu:withEvent:forView:
> but afaik, the above method does not give me control over what item is
> under the mouse when it pops up. The above only seems useful for
> contextual menus. I need to call whatever NSPopUpButton uses to bring
> up a menu. What is that?

Why don't you just make an instance variable in your custom class of type
NSMenu that holds the menu you want to pop up? That way, when you get a
mouseDown event, you can simply use that NSMenu in
popUpContextMenu:withEvent:forView:

mw
_______________________________________________
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: 
 >implementing pop up menus (From: James McCartney <email@hidden>)

  • Prev by Date: Fix for fix_prebinding crashes in 10.2.3?
  • Next by Date: Re: contextual menu in NSTableView cell - NEW
  • Previous by thread: implementing pop up menus
  • Next by thread: Re: implementing pop up menus
  • Index(es):
    • Date
    • Thread