> Le 7 janv. 2020 à 18:53, JP HARMAND via Cocoa-dev <cocoa-dev@lists.apple.com> 
> a écrit :
> 
> 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 ?

Because: “Only one item per menu can be highlighted at a time. If item is nil, 
it means that all items in the menu are about to be unhighlighted.”

> 2) How to know which item is under the mouse, whatever the item state ?
> 
> Thanks for any idea !!
> 
> Regards
> JP
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/mailing%40xenonium.com
> 
> This email sent to mail...@xenonium.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to