• 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: Cursor over links in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cursor over links in NSTextView


  • Subject: Re: Cursor over links in NSTextView
  • From: Rainer Brockerhoff <email@hidden>
  • Date: Tue, 4 Dec 2001 14:44:05 -0200

Date: Mon, 03 Dec 2001 22:30:20 -0600
From: Donald Brown <email@hidden>

I got my code working that uses NSScanner to recognize URLs and add a
NSLinkAttribute as well as highlighting the URL, and clicking on the URL
will launch the url as appropriate. (After cleaning up the code, I'll be
releasing it somewhere appropriate.) But I've still got an I-bar cursor
when the mouse moves over the link. Is there any way to tell the system to
switch to another cursor when the mouse moves over a link?

You need to call -[NSView addCursorRect: cursor:] for each link's rectangle. I nearly got this to work, and gave up after some tries. Later I realized that you can't find out the glyph boundaries for each link without having the complete text rendered first; as I was trying to set everything up before showing anything, it didn't work. I'm not sure how to have the layout manager render the whole text without displaying it and not flashing something on the screen.

Sorry for the sketchy tip, I'll return to this in a couple of weeks...

--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Dec. 2001)


  • Prev by Date: Re: JavaBridge
  • Next by Date: Re: Why resizing doesn't work for me ?
  • Previous by thread: Cursor over links in NSTextView
  • Next by thread: Re: Cursor over links in NSTextView
  • Index(es):
    • Date
    • Thread