Re: Detect URL in NSTextView
Re: Detect URL in NSTextView
- Subject: Re: Detect URL in NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Wed, 09 Mar 2005 12:44:45 -0800
On 2005-03-08 19:37:13 -0800 Adam <email@hidden> wrote:
I have an NSTextView that is the output of a chat session. If a user
posts a
line that contains a url (http://www.google.com), I would like to
make it
blue, underlined and clickable. Is there any simple way to do this?
Use whatever heuristic you choose for detecting URLs in the text.
When you detect one, add the attribute NSLinkAttributeName to that
range with the corresponding NSURL as a value.
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