質問

I'm a starting developer and I have this single window Mac application with a custom view inside. Inside that custom ceix I have defined multiple nsbezierpath. Each nsbezierpath represents a region of my map so they are not rectangular at all.

What I would like to have is a way to detect when my mouse enter a nsbezierpath so that I could display the name of the region over which the mouse is hovering.

I can't seem to find where to start, any ideas ?

Thanks for looking into my problem

役に立ちましたか?

解決

Set up a tracking area to detect mouse movement (NSTrackingArea). Be sure that the mouse location is in the view coordinate system, then use the location in a call to containsPoint: on each bezier path to determine which ones the mouse is over.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top