Re: NSTextView tooltips
Re: NSTextView tooltips
- Subject: Re: NSTextView tooltips
- From: Douglas Davidson <email@hidden>
- Date: Tue, 15 Feb 2005 17:29:11 -0800
I found the NSToolTipAttributeName text attribute, but that's too
static. I
need to generate the tool tip range dynamically based on where the
mouse is
hovering.
How should I approach this problem?
Here's one possible approach: override -[NSTextView mouseMoved:], and
in your implementation determine whether you want a tooltip for a
range of text near the mouse. If so, set NSToolTipAttributeName as a
temporary attribute on the layout manager for the range in question,
with the desired tooltip as value. Then call [super mouseMoved:]. At
some point later on you'll probably want to remove the temporary
attribute, perhaps when the mouse moves outside of the region of
interest. See the NSLayoutManager documentation for more on temporary
attributes.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden