Re: Unexpected mouse-handling behaviour
Re: Unexpected mouse-handling behaviour
- Subject: Re: Unexpected mouse-handling behaviour
- From: Michael Ash <email@hidden>
- Date: Mon, 23 Feb 2009 09:15:44 -0500
On Mon, Feb 23, 2009 at 8:45 AM, Manuel Meyer <email@hidden> wrote:
> Hmm, the endPoint and startingPoint are just helpers right now to visualize
> the mouse interaction. I haven't done any coding on the vertices between two
> Nodes yet.
> I wanted to connect the Nodes without using the superview, but maybe I have
> to? What is the best way to find out, what View(s) are located at a certain
> point?
Certainly you don't have to use the superview, since you can run
equivalent code in either place. Which would be the better design,
that's hard to say. Personally I would use the superview rather than
the subviews, but obviously that's up to you.
You can find the view at any given location by using the -hitTest:
method of NSView. Be careful of the coordinate system of the point
that it takes, as it's a little unusual. You can use that to see what
view the mouse is over in the -mouseUp: method, and then communicate
with it to hook things up if it's the right kind of view.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden