Re: HTML link from TextView
Re: HTML link from TextView
- Subject: Re: HTML link from TextView
- From: Lars Sonchocky-Helldorf <email@hidden>
- Date: Sat, 23 Mar 2002 21:13:36 +0100
Am Dienstag den, 5. Mdrz 2002, um 20:16, schrieb Douglas Davidson:
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
I am glad that someone responds this topic since I had the same question
too.
How do I add such an attribute? I have texts (which are in TextViews)
stored in nibs. Can this be done with IB somehow?
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.
the default behaviour would be fine for me.
Douglas Davidson
greetings, Lars
_______________________________________________
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.
_______________________________________________
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.