Re: Multiple tooltips
Re: Multiple tooltips
- Subject: Re: Multiple tooltips
- From: Douglas Davidson <email@hidden>
- Date: Fri, 7 Sep 2001 10:02:18 -0700
On Friday, September 7, 2001, at 09:16 AM, Youngjin Kim wrote:
Have anyone ever successfully tried multiple tooltips in different part
of a view?
I'm looking at addToolTipRect/removeToolTip pair. These look like what
I should use. but cannot figure out what should be sent to
'userData'. Any Idea?
- (NSToolTipTag)addToolTipRect:(NSRect)aRect owner:(id)anObject
userData:(void *)data;
- (void)removeToolTip:(NSToolTipTag)tag;
If you use these methods, then the owner will usually implement the
following method:
@interface NSObject(NSToolTipOwner)
- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag
point:(NSPoint)point userData:(void *)data;
@end
where the userData is an arbitrary pointer of your choice, that may help
you to identify the tool tip--use NULL if this is not of use to you.
(If the owner does not implement view:stringForToolTip:point:userData:,
then the tool tip will show the owner's description.)
Douglas Davidson