Re: String color
Re: String color
- Subject: Re: String color
- From: Ondra Cada <email@hidden>
- Date: Wed, 19 Sep 2001 23:33:48 +0200
John,
>
>>>>> John Hornkvist (JH) wrote at Wed, 19 Sep 2001 22:42:43 +0200:
JH> NSStrings don't have color; use NSAttributedString if you want to set
JH> properties like color, font etc.
JH>
JH> For simple drawing, the string should accept the graphics contex:
JH> [[NSColor redColor] set];
JH> [string drawAtPoint:NSMakePoint(10,10)];
Or explicit attributes, like
[string drawAtPoint:pt withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
font,NSFontAttributeName,
color,NSForegroundColorAttributeName,
nil]];
whatever you found more convenient.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc