views:

214

answers:

1

Hi.
I have a NSStatusItem and I want to popup a menu by rightclicking the item. I subclassed a NSView and overwrote the - (void)rightMouseDown:(NSEvent *)event method. I also implemented - (void)mouseDown:(NSEvent *)event for looking at the modifierflags. My problem is, that the view does not recieve the NSRightMouseDown-Event. And I don't know why? Any ideas how to get this event? Naturally I added the custom view to the statusitem.

- UPDATE -
Additional information: I have added a NSImageView to my custom view's subviews.

- UPDATE 2 -
Additional information: It conforms to the NSMenuDelegate protocol.

+1  A: 

Ok. Problem solved. The problem was the NSImageView. I subclassed it and now I redirect all mouseDown and rigthMouseDown events to its superview (my custom view).

papr