문제

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