Re: word-wrap in cells of an NSTableView?
Re: word-wrap in cells of an NSTableView?
- Subject: Re: word-wrap in cells of an NSTableView?
- From: Erik Hanson <email@hidden>
- Date: Sat, 15 May 2004 18:53:42 -0700
On May 14, 2004, at 11:18 PM, Steven D.Arnold wrote:
I have an NSTableView which contains one column, and each cell is an
example sentence, which can be at least somewhat long. I would like
each cell in the NSTableView to word-wrap, so that the right-hand
side of the text is not obscured. I haven't been able to find an
easy way to do this -- any ideas?
On May 15, 2004, at 12:03 AM, cricket wrote:
Perhaps there are other ways to do this, but I usually use an
attributed string. One of the attributes you can set on an attributed
string is the NSParagraphStyleAttributeName. A paragraph style can
have a line-break mode. There is a chart of possible line-break modes
in this document:
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSParagraphStyle.html
NSLineBreakByWordWrapping is probably the one you want.
I tried to do this and it failed. I could get it to truncate with
ellipses, but I could not get it word wrap.
The related messages I've seen in the Mamasam archives seem to say that
the text is wrapping but the cell height won't change (because all rows
must be the same height).
Is this right, or has it changed recently and NSTableView cell wrapping
is now available?
Erik Hanson
_______________________________________________
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.