Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tool tips in NSTableView



I want to display tool tips for items in a NSTableView (and also in a NSOutlineView, but I figure the solution might be similiar). That is, every item will have a different tool tip...

Looking at the AppKit header files revealed that NSView has a method

- (NSToolTipTag)addToolTipRect:(NSRect)aRect owner:(id)anObject userData:(void *)data;

which looks helpful. However, as so often, the docs only say "Description forthcoming" :/ and I have no clue how I actually would use that method. Userdata seems fair enough, but what exactly does aRect specify? I figure I have to subclass NSToolTipOwner, and handle:

- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data;

Userdata is quite clear; and with point, I guess I could use one handle for my whole tableview, which would be nice; but still, "aRect" puzzles me. Should I pass the full view rect of the view, or a rect of the item or what?!?

--
-----------------------------------------------
Max Horn
C++/ObjC/Java Developer

email: <mailto:email@hidden>
phone: (+49) 6151-494890




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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.