• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView misspelled words style underline
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView misspelled words style underline


  • Subject: Re: NSTextView misspelled words style underline
  • From: "I. Savant" <email@hidden>
  • Date: Sun, 20 May 2007 11:26:40 -0400

Caleb:

If I recall correctly, there are similar threads in this list's archives discussing the same thing. It was stated then that the spelling underline effect is achieved with an image.

In short, you'll probably want to handle this with drawing (NSTextView's -drawViewBackgroundInRect: method) and do your own custom drawing (I'd use NSBezierPath rather than an image ... just seems cleaner).

--
I.S.


On May 20, 2007, at 8: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?

-Caleb
_______________________________________________

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:
40gmail.com


This email sent to email@hidden

_______________________________________________

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


References: 
 >NSTextView misspelled words style underline (From: Caleb Cannon <email@hidden>)

  • Prev by Date: NSTextView misspelled words style underline
  • Next by Date: Observing related attributes via a to-many relationship
  • Previous by thread: NSTextView misspelled words style underline
  • Next by thread: Re: NSTextView misspelled words style underline
  • Index(es):
    • Date
    • Thread