Is it possible to get an NSView to pass rightMouseDown: to the next responder without subclassing?
- by Benedict Cohen
I have a view which contains a few subviews:
mainView
subViewA
subViewB
SubViewC
mainView is an NSView constructed from a nib and is controlled with an NSViewController subclass. The subviews are standard views such as NSTextField and NSImageView and are configured to be non-editable. I want mainView to receive rightMouseDown: even when the event is triggered in one of the subviews.
The default implementation of rightMouseDown: in NSResponder passes the event to the next responder, but NSView changes the default behaviour and does not pass it to the next responder.
I could subclass all of the subviews but this doesn't seem like a very elegant or maintainable solution.
How can I get the subviews to pass rightMouseDown: messages to the next responder without subclassing all of the subviews?