On Sep 19, 2009, at 00:03, John C. Randolph wrote:


Looks like NSFontColorAttribute is deprecated after 10.4. Try NSForegroundColorAttributeName instead.

-jcr




John, I just tried this:

NSFontDescriptor *currentFontDescriptor = [[self font] fontDescriptor];
NSMutableDictionary *fontAttributes = [NSMutableDictionary dictionaryWithDictionary:[currentFontDescriptor fontAttributes]];
if ([self isEnabled])
[fontAttributes setObject:[NSColor blackColor] forKey:NSForegroundColorAttributeName];
else
[fontAttributes setObject:[NSColor lightGrayColor] forKey:NSForegroundColorAttributeName]; currentFontDescriptor = [NSFontDescriptor fontDescriptorWithFontAttributes:fontAttributes]; NSFont *fontToUse = [NSFont fontWithDescriptor:currentFontDescriptor size:[[self font] pointSize]];

With no result:

(gdb) po currentFontDescriptor
NSCTFontDescriptor <0x4a75e0> = {
    NSColor = NSCalibratedWhiteColorSpace 0.666667 1;
    NSFontNameAttribute = LucidaGrande;
    NSFontSizeAttribute = 11;
}
(gdb) po [fontToUse fontDescriptor]
NSCTFontDescriptor <0x457af0> = {
    NSFontNameAttribute = LucidaGrande;
    NSFontSizeAttribute = 11;
}

Why is the font ignoring the NSColor attribute?
-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin                                 
http://nemesys.dyndns.org
Logiciels Nemesys Software                                              
laurent.daude...@verizon.net
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to