Re: Links in NSTextField
Re: Links in NSTextField
- Subject: Re: Links in NSTextField
- From: Uli Kusterer <email@hidden>
- Date: Thu, 24 Aug 2006 11:45:31 +0200
Am 24.08.2006 um 07:47 schrieb Dimitri Bouniol:
How can I programatically make an NSTextField into a hyperlink?
I wasn't able to get it to work. The closest I got was replacing my
NSTextField with an NSTextView. Then I could set its text to an
attributed string on which I'd set the link attribute to an NSURL.
However that only displayed correctly, it didn't actually respond to
clicks. I tried to override -textView:clickedOnLink:atIndex:, but for
some reason that didn't seem to get called.
In my case it wasn't really an important enough feature that I
pursued it beyond that (lots of other things to finish in the app
first). If you have static text, you could probably try loading HTML
into an attributed string. That works for the about panel, so maybe
that works automatically. Or maybe the about panel delegate does it,
in which case you're stuck again...
It might also be worth searching the net, maybe there's source code
available via koders or so that does this and shows how it's done.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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