• 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: Hyperlink in an NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hyperlink in an NSTableView


  • Subject: Re: Hyperlink in an NSTableView
  • From: Greg Herlihy <email@hidden>
  • Date: Thu, 16 Mar 2006 06:51:43 -0800
  • Thread-topic: Hyperlink in an NSTableView

Assign the table an NSTextFieldCell as its dataCell class. For content,
create an NSMutableAttributedString initialized with HTML text that contains
a link. Lastly set the attributed string's cursor property to an arrow
cursor.

Something along the lines of:

    NSString * htmlStr  = @"<HTML><BODY><a href=\"http://www.apple.com\";>
                             my link</a></BODY></HTML>";

    NSData * data = [htmlStr dataUsingEncoding:NSASCIIStringEncoding];

    id s = [[[NSMutableAttributedString alloc] initWithHTML:data
             documentAttributes:nil] autorelease];

    [s addAttribute:NSCursorAttributeName value:[NSCursor arrowCursor]
         range:NSMakeRange(0, [s length])];


Greg


On 3/15/06 3:25 PM, "Marcus S. Zarra" <email@hidden> wrote:

> Is there an easy way to display a hyperlink in a NSTableView and have
> it clickable and have the mouse over behave as expected?
>
> Any tips would be greatly appreciated.
>
> Marcus
>  _______________________________________________
> 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

  • Follow-Ups:
    • Re: Hyperlink in an NSTableView
      • From: "Marcus S. Zarra" <email@hidden>
References: 
 >Hyperlink in an NSTableView (From: "Marcus S. Zarra" <email@hidden>)

  • Prev by Date: Re: Split View like the one in Mail.app
  • Next by Date: Accessing window back buffer without deprecated functions in Tiger
  • Previous by thread: Hyperlink in an NSTableView
  • Next by thread: Re: Hyperlink in an NSTableView
  • Index(es):
    • Date
    • Thread