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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to