+ // Set the color (and later font) attributes
+ NSColor *fgColor = m_textForegroundColour.GetNSColor();
+ NSColor *bgColor = m_textBackgroundColour.GetNSColor();
+ if(!fgColor)
+ fgColor = [NSColor clearColor];
+ if(!bgColor)
+ bgColor = [NSColor clearColor];
+ NSDictionary *attrDict = [[NSDictionary alloc] initWithObjectsAndKeys:
+ fgColor, NSForegroundColorAttributeName,
+ bgColor, NSBackgroundColorAttributeName,
+ nil];
+ [sm_cocoaNSTextStorage addAttributes: attrDict range:NSMakeRange(0,[sm_cocoaNSTextStorage length])];
+ [attrDict release];
+