I have an NSTextView for which I set the default link style attributes using the -setLinkTextAttributes: method. This is the style I want to use for outbound links.
In the text view, I also have interactive access areas that call functions inside the text view. I implemented them as links. I want them to be styled independently of outbound links. The logical way to write the code was as follows:
[attrStr addAttribute:NSLinkAttributeName value:@"myapp://togglesomething" range:hlRange]; [attrStr addAttribute:NSForegroundColorAttributeName value:[NSColor yellowColor] range:hlRange];
But the color of the links does not change to the one I set here.
So the question is:
- Can I change the color of individual links?
- If not, can I create an area that behaves like a link without being an element of the link?
source share