Re: tableView column ellipses
Re: tableView column ellipses
- Subject: Re: tableView column ellipses
- From: Jesse Grosjean <email@hidden>
- Date: Thu, 20 Nov 2003 21:12:35 -0500
Shawn,
I'm trying to get ellipses in a table view also, but I couldn't get
your suggestion to work for me. Has anyone got this to work?
With panther NSLineBreakByTruncatingMiddle now works, but I'm not sure
how to use it with an NSTextFieldCell. I can use this code:
NSMutableParagraphStyle *style = [[[NSMutableParagraphStyle alloc]
init] autorelease];
[style setLineBreakMode:NSLineBreakByTruncatingMiddle];
NSMutableAttributedString *truncatedMiddle =
[[NSMutableAttributedString alloc] initWithString:myString];
[truncatedMiddle addAttribute:NSParagraphStyleAttributeName value:style
range:NSMakeRange(0, [result length])];
To create a string that will be truncated when displayed in a
NSTextView, but I can't seem to do the same thing for a
NSTextFieldCell.
Any ideas? What's the best way to use NSLineBreakByTruncatingMiddle so
that strings in a NSTableView get truncated?
Thanks,
Jesse
On Nov 19, 2003, at 7:32 PM, Kurt Marek wrote:
How do I get truncated text in a column of an NSTableView to show
ellipses when the column isn't wide enough to show the full text? For
an example of the behavior I want, see iTunes. Is this a simple
setting that I haven't located or is it done programmatically?
I believe in IB (interface builder) you simply focus the inspector on
your NSTableView column and click on the alignment button that has the
"..." in it (it is on the attributes panel in the inspector).
-Shawn
_______________________________________________
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.