Re: NSTextView and changing the selected text's color
Re: NSTextView and changing the selected text's color
- Subject: Re: NSTextView and changing the selected text's color
- From: Graham Cox <email@hidden>
- Date: Thu, 12 Jun 2008 23:46:57 +1000
Definitely sounds like a bug - file it anyway, they can only say
"behaves as expected" (and probably will... ;-)
I would expect that if I set my foreground text to some pale colour, I
could set a different colour for selected text so it has contrast with
the background selection colour, not just work for black text.
G.
On 12 Jun 2008, at 7:47 pm, Mattias Arrelid wrote:
Sorry for my many replies...
It turns out that if you set the NSForegroundColorAttributeName of the
attributed string in NSTextView's text storage, the call to
setSelectedTextAttributes: doesn't have any effect when called as
described below:
NSMutableDictionary *dict = [[[textView selectedTextAttributes]
mutableCopy] autorelease];
[dict setObject:[NSColor redColor]
forKey:NSForegroundColorAttributeName];
[textView setSelectedTextAttributes:dict];
Setting the background color works fine though. I cannot see anything
regarding this limitation in the documentation - is it by design or is
it a bug?
_______________________________________________
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