Detecting which NSMenuItem is under the mouse (cocoa objective C)
Detecting which NSMenuItem is under the mouse (cocoa objective C)
- Subject: Detecting which NSMenuItem is under the mouse (cocoa objective C)
- From: JP HARMAND via Cocoa-dev <email@hidden>
- Date: Tue, 7 Jan 2020 18:53:59 +0100
While a NSMenu item is opened, some items are disabled and some are enabled,
exactly as wanted .
Moving the mouse over this menu , I now want to know which item is under the
mouse what ever it’s sate is.
I am notified with -(void)menu (NSMenu*)menu
willHighlightItem(NSMenuItem*)menuItem each time the mouse moves over an item
But if this item is disabled, the returned menuItem in nil… hense I cannot know
which item it is.
So 2 questions arise :
1)Why willHighlightItem is notified with a disabled item , as the item will
obviously not being highlighted ?
2) How to know which item is under the mouse, whatever the item state ?
Thanks for any idea !!
Regards
JP
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden