Hi Douglas,

On Wed, Jun 11, 2008 at 5:30 PM, Douglas Davidson <[EMAIL PROTECTED]> wrote:
>
> On Jun 11, 2008, at 3:24 AM, Mattias Arrelid wrote:
>
>> Haven't anyone stumbled upon something similar, or a solution to this?
>
> I believe it was answered.  You don't want to use setMarkedTextAttributes:,
> because marked text is the uncommitted text you see while using an input
> method.  You can use setSelectedTextAttributes: instead.

It seems that I forgot to mention that I've tried that without
success. I can successfully set the background color of the selection
using this (in the initWithFrame: method of my custom text view):

NSMutableDictionary *dict = [[[self selectedTextAttributes]
mutableCopy] autorelease];
[dict setObject:[NSColor redColor] forKey:NSBackgroundColorAttributeName];
[self setSelectedTextAttributes:dict];

Now, any selected text will have a red background selection. Changing
the NSBackgroundColorAttributeName attribute to
NSForegroundColorAttributeName makes the selection background color
the system's default again, but doesn't affect the color of the
selected text.

Am I missing something here?

Regards
Mattias
_______________________________________________

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