Hi,
Citát Günther Noack <[EMAIL PROTECTED]>:
>
> Hi!
>
> Am 27.03.2006 um 03:13 schrieb Nicolas Roard:
> > Yes, I think it would be great to commit it to svn. From the
> > screenshot I infer that links in the text aren't parsed yet ? (the {
> > })
>
> Yes, that's right. For the moment I still need to find out how to
> realize
> hyperlink-like functionality with a NSTextView.
>
> Does somebody on Etoile-Dev know how to do that?
>
See -[NSAttributedString setAttributes:range:] in [1].
Where the attributes dictionary [2] would be:
[dict setObject:myLink forKey:NSLinkAttributeName]
where myLink would be anything you consider a link, it can be a NSString, it can
be NSURL, it can be whatever you liek.
Then you implement in your NSTextView delegate a method [3]:
- textView:clickedOnLink:atIndex:
Where you would handle a click on a link (you have to find the link attribute at
given index).
Regards,
Stefan Urbanek
References:
[1]http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSMutableAttributedString.html
[2]http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSAttributedStringAdditions.html
[3]
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSTextView.html#//apple_ref/occ/instm/NSObject/textView:clickedOnLink:atIndex:
--
http://stefan.agentfarms.net
First they ignore you, then they laugh at you, then they fight you, then
you win.
- Mahatma Gandhi
_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev