Re: text color in NSTextView
Re: text color in NSTextView
- Subject: Re: text color in NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Mon, 25 Oct 2004 17:11:26 -0700
On Oct 25, 2004, at 5:00 PM, Todd Ransom wrote:
I have a text editing app based on NSTextView and a user has requested
the ability to set foreground and background colors. I established a
binding for background color and that works beautifully, but I am
having problems with setting the text color. I see that NSTextView
inherits the method setTextColor from NSText but it doesn't seem to do
what the documentation leads me to believe it should do. The docs say
"Sets the text color of all characters in the receiver..." but when I
call setTextColor it only changes the color of newly typed characters.
Existing text stays in whatever color it was before the change.
Ideally I would like to simply change the display font color for all
characters in the textview, not the font used in the attributed
string. I don't want the display settings to be saved with the
document. Has anyone done this successfully?
I'm not sure why you would be seeing this--setTextColor: should indeed
set the color for the entire text. If you want a color change that is
purely for display purposes, not saved with the text, however, you can
use temporary attributes on the layout manager, rather than altering
the text itself.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden