开发者

Custom hit test for 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜