Re: String color
Re: String color
- Subject: Re: String color
- From: John Hörnkvist <email@hidden>
- Date: Wed, 19 Sep 2001 22:42:43 +0200
On Wednesday, September 19, 2001, at 08:38 PM, Mark Wridt wrote:
I cannot figure out or find code to change a string's
color.
I have a color set, but getting the string to be that
color is causing errors (mostly selector not
recognized)
My color code (that is working):
NSColor *color;
color = [[NSColor redColor] retain];
but
[aString setColor:color];
[aString textColor:color];
[aString setTextColor];
(as well as other crazy combinations)
all are not working.
NSStrings don't have color; use NSAttributedString if you want to set
properties like color, font etc.
For simple drawing, the string should accept the graphics contex:
[[NSColor redColor] set];
[string drawAtPoint:NSMakePoint(10,10)];
Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com