Re: NSTextView, spell checking and temporary attributes
Re: NSTextView, spell checking and temporary attributes
- Subject: Re: NSTextView, spell checking and temporary attributes
- From: Martin Hewitson <email@hidden>
- Date: Mon, 02 Jan 2012 21:44:21 +0100
Yes, it seems I was mistaken. I also made a test app and can't reproduce the problem. So it must be something else I'm doing with the textview that stops the continuous spell checking from working.
Oh well, more digging to do.
Thanks for confirming!
Martin
On 2, Jan, 2012, at 08:07 PM, Seth Willits wrote:
> On Jan 2, 2012, at 10:20 AM, Martin Hewitson wrote:
>
>> [[self layoutManager] removeTemporaryAttribute:NSBackgroundColorAttributeName forCharacterRange:visibleRange];
>>
>> This has the unfortunate side-effect of removing the red squiggly lines which indicate misspelled words.
>
>
> Hmm. Works fine here.
>
>
> - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
> {
> [textView setString:@"Hello this is a reallly good day to be alive."];
> [[textView layoutManager] addTemporaryAttribute:NSBackgroundColorAttributeName value:[NSColor yellowColor] forCharacterRange:NSMakeRange(6, 4)];
> [[textView layoutManager] addTemporaryAttribute:NSBackgroundColorAttributeName value:[NSColor yellowColor] forCharacterRange:NSMakeRange(16, 7)];
> [textView checkTextInDocument:nil];
> }
>
>
> - (IBAction)action:(id)sender;
> {
> [[textView layoutManager] removeTemporaryAttribute:NSBackgroundColorAttributeName forCharacterRange:NSMakeRange(0, textView.string.length)];
> }
>
>
>
> --
> Seth Willits_______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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