• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView - Text Style
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTableView - Text Style (From: Jerry Brace <email@hidden>)

  • Prev by Date: Re: NSImageView and custom cells....
  • Next by Date: Re: Slow horizontal scrolling w/NSMutableAttributedStrings
  • Previous by thread: NSTableView - Text Style
  • Next by thread: Seeking wisdom: Control overlayed on top of NSTableView
  • Index(es):
    • Date
    • Thread