Re: How To: NSAttributedString in a NSTableView, catch clicks on a link
Re: How To: NSAttributedString in a NSTableView, catch clicks on a link
- Subject: Re: How To: NSAttributedString in a NSTableView, catch clicks on a link
- From: John Buckley <email@hidden>
- Date: Fri, 9 Dec 2005 11:04:50 +0000
Hi,
AFAIK the only way to intercept clicks in a table cell is to use a
NSButtonCell (at least without subclassing an AppKit cell). To make
the button look like a text cell (get rid of any decoration) set its
type to "Rounded Bevel Button" and its behaviour to "Momentary
Change".
You then set the button cell's attributeTitle property (with your
attributed string). In addition to the normal attributes set
NSLinkAttributeName to the url you need (I expect you've already done
this).
Then in your controllers action method (connected to the button cell)
extract the url from the attributedTitle and launch it.
Hope this helps,
John
On 12/9/05, devmaillists <email@hidden> wrote:
>
Dear Cocoa List,
>
>
I moved in trouble to get the clicks made in links of
>
NSAttributedString.
>
I like to have a NSTableView with textcells containing several links.
>
I found no way to get the clicks made on a link in the
>
NSAttributedString.
>
With NSTextView it is no problem. NSTableView drives me mad.
>
>
Thanks in advance for any help on this topic.
>
I found only 10 items of this with google and one half was
>
advertisement for books.
>
>
Jürgen Sauerzapf
>
Engineering Office
>
>
_______________________________________________
>
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
>
_______________________________________________
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