• 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
Displaying NSAttributedStrings in an NSTableView with non-uniform row height
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Displaying NSAttributedStrings in an NSTableView with non-uniform row height


  • Subject: Displaying NSAttributedStrings in an NSTableView with non-uniform row height
  • From: "Christian Moen" <email@hidden>
  • Date: Thu, 22 May 2008 21:53:12 +0900

cocoa-dev,

I'd like to display textual information in varying fonts and sizes in
NSTableColumns using an NSAttributedString, but I'm having problems
getting my NSTableView to display the information using varying row
height.

My data source implements numberOfRowsInTableView: and
tableView:objectValueForTableColumn:row: and the latter returns
NSAttributeStrings for the columns and they render fine, but the
height is uniform across rows clipping the NSAttributedString.

In order to get the row height correctly, I understand I need to
implement tableView:heightOfRow:.  How can I find out how high my row
needs to be?  I know I can call size on an NSAttributedString, but the
height returned doesn't take line breakage introduced by the
NSTableColumn into account.  (My NSTableColumns use NSTextFieldCell
cells and "Line Breaks" in Interface Builder is set as "Character
Wrap".)

Advice on how to deal with the above is mostly appreciated.  The
complexity of this has me thinking I'm missing something important and
that I'm off down the wrong track.

Many thanks,


Christian
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Displaying NSAttributedStrings in an NSTableView with non-uniform row height
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: NSTextField will not become editable in a borderless window
  • Next by Date: Re: How to handle bad certificate error in NSURLDownload?
  • Previous by thread: Re: NSTextField will not become editable in a borderless window
  • Next by thread: Re: Displaying NSAttributedStrings in an NSTableView with non-uniform row height
  • Index(es):
    • Date
    • Thread