• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Links in NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Links in NSTextField
      • From: Michael Nickerson <email@hidden>
    • Re: Links in NSTextField
      • From: Chris Suter <email@hidden>
References: 
 >Links in NSTextField (From: Dimitri Bouniol <email@hidden>)

  • Prev by Date: Re: nibs, subclassing nsview
  • Next by Date: Re: Links in NSTextField
  • Previous by thread: Links in NSTextField
  • Next by thread: Re: Links in NSTextField
  • Index(es):
    • Date
    • Thread