Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
NSTrackingArea, Pie charts and not rectangular areas
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTrackingArea, Pie charts and not rectangular areas



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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.