Displaying NSAttributedStrings in an NSTableView with non-uniform row height
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