Re: Once again: Clickable hyperlink in NSTableView
Re: Once again: Clickable hyperlink in NSTableView
- Subject: Re: Once again: Clickable hyperlink in NSTableView
- From: "Johannes Fahrenkrug" <email@hidden>
- Date: Tue, 5 Feb 2008 08:55:23 +0100
Ok, so if I follow that path, I'll be able to have the cell show just
text in some rows (the ones with error messages) and display a
clickable NSButtonCell in the rows with an URL? I will have to code
the "open this url in the browser"-part myself in that case, right?
I was hoping that there would be a way to use NSAttributedString in
some way: I can *display* a hyperlink with NSAttributedString (via
initiWithHTML:@"...<a href=\"http://someurl\">Click</a>...." in my
table, but I can't click on the hyperlink.
So the only way is to use NSButtonCell to actually make a button that
the user clicks on within the table column?
Just to take this one step further, out of curiosity: What if I'd want
to have Text with a hyperlink show up in a table cell, ie: "To visit
our website click here!" and only the "click here" part being
clickable. That would not be solved with the NSButtonCell approach,
right?
Would the only solution be a custom TableCell?
Sorry for all the questions, I just want to make sure I get in straight :)
- Johannes
On Feb 4, 2008 5:00 PM, I. Savant <email@hidden> wrote:
> > I don't have to select the rows, having the cell clickable would be
> > enough: But the cell is not a hyperlink in every row: in some rows,
> > the cell should display a clickable URL, in other cases it displays a
> > status or error msg text.
>
> In that case, you could use
> -tableView:willDisplayCell:forTableColumn:row: to adjust the
> formatting (and "enabled" state) of the button cell representing your
> clickable URL *or* simply swap it out with another cell type
> altogether.
>
> --
> I.S.
>
_______________________________________________
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