• 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: Handling NSMenuItem Selections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling NSMenuItem Selections


  • Subject: Re: Handling NSMenuItem Selections
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Mon, 10 May 2004 19:15:05 -0700

Hello...

Behind the scenes, the menus that are displayed in a Cocoa application are actually Carbon menus. NSMenu and NSMenuItem would probably be considered closer to the model part of the MVC paradigm, and they don't really provide any of the user interaction. It would be very difficult to implement the functionality you are describing.

Also, the behavior you are describing would probably conflict with the way that standard menus work. Since menus can be accessed by either clicking and holding down the mouse button while navigating the menu or by clicking on the menu title to open the menu, dragging would interfere with normal menu tracking for the first case (or at least create situations where it would be difficult to determine the correct behavior).

Louis



I see. [sender title] gives me the title of what I clicked on, and I can set a tag to an index value if I want. That's perfect for selecting items from the menu.

Any ideas on how I might drag an image from the menu item onto my NSView? I looked at the documentation for NSMenuItem and NSMenu, and I didn't see anything in there regarding overriding a mousedown action.

David
_______________________________________________
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: Handling NSMenuItem Selections
      • From: "David Piasecki" <email@hidden>
References: 
 >Handling NSMenuItem Selections (From: "David Piasecki" <email@hidden>)
 >Re: Handling NSMenuItem Selections (From: Jeremy Dronfield <email@hidden>)
 >Re: Handling NSMenuItem Selections (From: "David Piasecki" <email@hidden>)

  • Prev by Date: Re: Handling NSMenuItem Selections
  • Next by Date: Re: Handling NSMenuItem Selections
  • Previous by thread: Re: Handling NSMenuItem Selections
  • Next by thread: Re: Handling NSMenuItem Selections
  • Index(es):
    • Date
    • Thread