Re: HTML link from TextView
Re: HTML link from TextView
- Subject: Re: HTML link from TextView
- From: Douglas Davidson <email@hidden>
- Date: Tue, 5 Mar 2002 11:16:56 -0800
On Monday, March 4, 2002, at 05:46 PM, Paul A. Seligman wrote:
In some Carbon programs, I have seen the ability to control click on a
http link from a text view that results in opening said link in the
default browser. Is there something that will do some or all of this
under Cocoa? I'm mostly concerned with parsing
out the clicked link. As of now, the closest thing I have come across
is a double click selecting one section (separated by /'s) of an html
link. Any ideas?
Add an attribute with key NSLinkAttributeName and value some appropriate
NSURL to the relevant range in your text storage. Your textview's
delegate will be notified when the link is clicked on, and will be able
to handle it; or, if you do not implement that method or choose not to
handle it yourself, the default behavior will be to pass the URL to
Launch Services to be opened.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.