views:

219

answers:

1

I have a series of nested views and I need to catch the mouseDown event ant do the same thing when any of these views are selected. Is there a way to tell a superview to handle events for its subviews? Is the best way to handle this to put a transparent view on top of all my other views and have this view handle the events?

+1  A: 

Do your subviews define their own mouseDown:?

If they do not already define their own -[… mouseDown:(id)event], then they should already be passing their events up the responder chain, which should get to your superview.

Otherwise, (in addition to whatever other handling they need to do) they need to decide which events the superview should also receive and call [super mouseDown:event] for those events.

Chris Johnsen