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.
精彩评论