• 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: Hyperlinks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hyperlinks


  • Subject: Re: Hyperlinks
  • From: Greg Titus <email@hidden>
  • Date: Thu, 8 Jan 2009 14:31:11 -0800

Hi Matt,

You need to use an NSTextView here rather than an NSTextField. The behavior you are seeing is because an NSTextField is not 'active' until clicked upon, and then it gets the window's field editor (which is a shared NSTextView used by all fields on the window), and places that view on top of the text field and uses it to edit the text. It is NSTextView that handles the link hand cursor, and et cetera.

Hope this helps,
	- Greg

On Jan 8, 2009, at 4:02 AM, Matthew Morton wrote:

Hi all,

I have a NSTextField in Interface Builder that is quite large and includes a number of lines, one of which I want to be a hyperlink. I have bound the value of the NSTextField to an NSAttributedString in a custom class and set attributes for NSLinkAtributeName, NSForegroundColorAtributeName, and NSUnderlineStyleAttributeName. Back in Interface Builder I have set the NSTextField to be selectable, allow rich text, and the control state enabled. When I build and run my app the text appears as expected but there is no 'finger-style' cursor when I hover over the hyperlink, just the 'text-edit' style one until I click on the textfield. At this point the text changes size and the hyperlink becomes clickable.

Anybody have any ideas on what I am doing wrong and any pointers to help me resolve this issue.

Thanks,

Matt.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Hyperlinks (From: Matthew Morton <email@hidden>)

  • Prev by Date: Re: Encryption and Security
  • Next by Date: What's the most cocoa-ey pattern for this?
  • Previous by thread: Hyperlinks
  • Next by thread: Re: Hyperlinks
  • Index(es):
    • Date
    • Thread