I have an NSTextView for which I have set default link style attributes using the -setLinkTextAttributes: method. This is the style I wish to use for outgoing links.
In the text view I also have clickable areas that trigger functions inside the text view. I have implemented these as links. I want these to be styled independently of the outgoing links. So the logical way to write the code was like this:
[attrStr addAttribute:NSLinkAttributeName
value:@"myapp://togglesomething"
range:hlRange];
[attrStr addAttribute:NSForegroundColorAttributeName
value:[NSColor yellowColor]
range:hlRange];
But the color of the links do 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 as a link without being a link item?