On Thursday, May 1, 2003, at 03:42 PM,
<cocoa-dev-request...> wrote:
> I have a custom view that contains other views, yet I want to initiate
> a drag
> from the entirety of the top view (command clicking anywhere within
> the top
> view starts a drag). What is the easiest/simplest way to marshall
> all the
> mouseDown handling to get this to happen? Do I need to override
> mouseDown:
> with all the interior views and pass control up to the superview?
> Some of
> the interior views need to respond to clicks. Command clicks would
> start a
> drag.
You should override the hitTest: method (declared in NSView) in your
top view. This method is called to determine which view a mouse event
should be sent to. If you want to hide clicks from the subviews in
some instances, just return self in those cases, and return [super
hitTest:theEvent] in others.
--
Brian Webster
<bwebster...>
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | <cocoa-dev...>
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.