Re: NSTextView misspelled words style underline
Re: NSTextView misspelled words style underline
- Subject: Re: NSTextView misspelled words style underline
- From: Douglas Davidson <email@hidden>
- Date: Mon, 21 May 2007 10:39:35 -0700
On May 20, 2007, at 5:51 AM, Caleb Cannon wrote:
I'm using a subclass of NSTextView to provide some additional
functionality similar to the built in spell checker. When my code
encounters some interesting text I would like to underline it in
the same style as the spelling checker but with a different color.
Currently I use
[[self layoutManager] addTemporaryAttributes:tempAttrs
forCharacterRange:range];
to underline the text but I can not find the right combination of
attributes used by the standard underline (even though the
documentation claims this is how NSTextView does the underlining.
Is there some extra attribute I am unaware of or some other way to
achieve the same style underline?
The spelling underline is available using temporary attributes, but
it does not change color; it is itself a fixed pattern color based on
an image. If you want other colors, you will need to do the drawing
yourself.
If you are not wedded to the specific appearance of the spelling
underline, you could use a standard underline with a color and an
underline pattern, e.g. NSUnderlinePatternDot, via either normal or
temporary attributes.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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