Re: Displaying a table entry in Bold
Re: Displaying a table entry in Bold
- Subject: Re: Displaying a table entry in Bold
- From: j o a r <email@hidden>
- Date: Mon, 22 Apr 2002 10:13:35 +0200
I think it's even easier to do something like this:
NSFont *newFont = [[NSFontManager sharedFontManager]
convertFont:[cell font] toHaveTrait:NSBoldFontMask];
[cell setStringValue:@"Some String"];
[cell setFont:newFont];
j o a r
On Friday, April 19, 2002, at 04:44 PM, Eric Peyton wrote:
You can do something like this ...
NSFont *font = nil;
NSFont *listFont = <Whatever font you want to be bolded goes
here>;
NSMutableAttributedString* string = <whatever text you want
goes here> - example [[[NSAttributedString alloc]
initWithString:@"HeyThere"] autorelease];
font = [[NSFontManager sharedFontManager] convertFont:listFont
toHaveTrait:NSBoldFontMask];
[string addAttribute:NSFontAttributeName value:(font ? font :
listFont ) range:range];
[cell setAttributedStringValue:string];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.