Look like you text view does not allow rich text.

Make sure the Allow Rich Text check box is checked in your TextView config in IB or set it programaticaly using -[NSTextView setRichText:]

- (void)setRichText:(BOOL)flag
“Controls whether the text views sharing the receiver’s layout manager allow the user to apply attributes to specific ranges of text.”


Le 24 avr. 08 à 00:19, tyler durden a écrit :

Hi Everybody,
I am reposting this since I haven't got any answers, yet.
Hope somebody helps this time around.

I am writing an easy chat application. I have an object of NSTextview on my UI form. I want to change the text color in a specified range from default color black to red. I used the method "setTextColor:range:" but it did not work. Following is my declaration of the object and the corresponding code.

More specifically, the code below is supposed to change color of a certain range of characters (in the following case, between 1st and the 6th chars) but it doesn't really work. it either changes the color of the whole text to red when I start from zero or it doesn't make any changes if I start from 1.


Any suggestions ?????

IBOutlet NSTextView* _view;

[(_view) setTextColor:[NSColor redColor] range: NSMakeRange(1,5)];



____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
_______________________________________________

Cocoa-dev mailing list ([email protected])

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/devlists%40shadowlab.org

This email sent to [EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list ([email protected])

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