• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView tooltips
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTextView tooltips (From: Mark Alldritt <email@hidden>)

  • Prev by Date: Re: TCP/IP
  • Next by Date: Unconventional UI
  • Previous by thread: NSTextView tooltips
  • Next by thread: Unconventional UI
  • Index(es):
    • Date
    • Thread