开发者

Custom hit test for a contextual menu

开发者 https://www.devze.com 2023-01-27 09:57 出处:网络
I have a transparent NSView which draws a circle. I\'d like to customize the hit testing used when displaying a contextual menu.

I have a transparent NSView which draws a circle. I'd like to customize the hit testing used when displaying a contextual menu.

Currently it uses the bounding rectangle. I want to change it to test for a click inside 开发者_如何学Cthe circle.


Try overriding NSView menuForEvent: returning nil if you don't want the menu to show up and [super menuForEvent:] if you do.

0

精彩评论

暂无评论...
验证码 换一张
取 消