Re: Detecting which NSMenuItem is under the mouse (cocoa objective C)
Re: Detecting which NSMenuItem is under the mouse (cocoa objective C)
- Subject: Re: Detecting which NSMenuItem is under the mouse (cocoa objective C)
- From: Jean-Daniel via Cocoa-dev <email@hidden>
- Date: Tue, 7 Jan 2020 21:40:28 +0100
> Le 7 janv. 2020 à 18:53, JP HARMAND via Cocoa-dev <email@hidden>
> 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 (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
_______________________________________________
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