Re: NSTableView - Text Style
Re: NSTableView - Text Style
- Subject: Re: NSTableView - Text Style
- From: glenn andreas <email@hidden>
- Date: Thu, 26 May 2005 11:36:06 -0500
On May 26, 2005, at 10:28 AM, Jerry Brace wrote:
I'm trying to style some text in a NSTableViewColumn to have bold
text on one line and regular text on another.
As an example (iChat):
<bold>Name</bold>
<not bold>Status</not bold>
I'm been trying to figure out NSMutableStrings but I haven't gotten
very far.
Bascially I need to be able to bold portitions on a text value in a
NSTableView column.
Any help would be great!
Assuming you are using a data source (as opposed to bindings) you can
have your tableValue:objectValueForTableColumn:row: return an
NSAttributedString with the font set accordingly. For example (typed
in email, so typos abound):
return [[[NSAttributedString alloc] initWithString: @"Name"
attributes: [NSDictionary dictionaryWithObject: [NSFont
boldSystemFontOfSize: 12.0] forKey: NSFontAttributeName]]
autorelease]; // returns bolded "Name"
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden