• 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: Mouse over menu item event?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mouse over menu item event?


  • Subject: Re: Mouse over menu item event?
  • From: daniel <email@hidden>
  • Date: Sun, 13 Feb 2005 19:36:11 -0800

I don't think you can do this with NSMenu or NSMenuItem. As I usually say when somebody asks to do "stunts" with menus: use Carbon menus. You can either use a hack to get at the Carbon menu that is underlying the NSMenu in Cocoa, or if you're using the menu as a popup, it might be better to use a Carbon menu natively.

In my "Cocoa" menu bar utility, FastScripts, I use Carbon menus exclusively, precisely because I needed to do these kinds of "stunts."

While you're tracking user selection of a Carbon menu, you can ask for and receive "kEventMenuTargetItem" events, which tell you when the mouse has entered a menu item. There are many other events you can register for, and you can customize the contents of the menus and/or menu items to an extreme degree.

It would be nice if Apple publicized access to the underlying carbon menu for NSMenu. Since they abandoned the "cell based" implementation in favor of the Carbon wrapper implementation, developers are stuck in between without access to the compelling features of either approach.

Daniel

On Feb 10, 2005, at 1:39 PM, Luc Vandal wrote:

Hi!

I need to perform an action when the mouse is over a menu item. Is there a way to get notified about that event?

Thanks!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Mouse over menu item event? (From: Luc Vandal <email@hidden>)

  • Prev by Date: Re: Class design question
  • Next by Date: UDP SOCKETS!!
  • Previous by thread: Mouse over menu item event?
  • Next by thread: Refresh works, but...
  • Index(es):
    • Date
    • Thread