Re: Custom NSView and tooltips...
Re: Custom NSView and tooltips...
- Subject: Re: Custom NSView and tooltips...
- From: Jiva DeVoe <email@hidden>
- Date: Mon, 25 Feb 2008 00:37:48 -0700
Nevermind!
I figured it out! I discovered that I can pass any old object to the
addToolTipRect method, and that it will be asked for the tooltip for a
given point! Problem solved.
On Feb 25, 2008, at 12:17 AM, Jiva DeVoe wrote:
Greetings,
I have a custom NSView, which draws a pie chart. I want to
implement a tooltip for each slice of the pie to indicate
information about that slice for the user. The slices are not
rectangular, they are triangular. Thus, I can't just use
addToolTipRect:owner:userData.
So I had this clever idea that I would track mouseMoved events in
the custom view, and, when the mouse point is within one of the
slices, I would set the tooltip for the entire view to the string
for that slice. I figure it'll get reset when it moves to another
slice anyway, so it's all good.
The only problem is, my tooltip refuses to show up.
I'm calling [NSView setToolTip:] and I also have a tracking rect,
and I am receiving the mouseMoved events just fine. Is there some
kind of known reason my tooltips won't show up in this scenario?
I've set tooltips on custom views before without the mouse tracking
and not had much trouble. Alternatively, can someone recommend a
smarter way to do this?
Thanks.
_______________________________________________
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
_______________________________________________
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