NSTrackingArea, Pie charts and not rectangular areas
NSTrackingArea, Pie charts and not rectangular areas
- Subject: NSTrackingArea, Pie charts and not rectangular areas
- From: Adhamh Findlay <email@hidden>
- Date: Tue, 15 Jan 2008 09:30:51 -0600
Hello,
I've currently got several classes that implement a pie chart for the
application I'm working on. The pie chart appears in a subview of a
window and this subview has an NSTrackingArea. The pie chart itself
is drawn using NSBezierPath, where each section of the pie chart is
its own path. As each section is drawn you end up building the pie
chart. Also, as each path is created I add it to a dictionary as a
key and make the associated value a string that will be the tooltip
for that section.
Then, in mouseMoved I iterate over the dictionary keys and if the key
(an NSBezierPath) returns YES for containsPoint I set the toolTip.
The main problem with this implementation appears to be that the
tooltip won't change unless I leave the subview and reenter it. I've
tried removeAllToolTips to fix this problem, but it didn't help.
Does anyone have suggestions on a better implementation? I'd love to
have a tracking area setup for each pie chart section, but this
doesn't seem to be possible since the sections are not rectangular.
Thanks,
Adhamh
_______________________________________________
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