Re: tableView column ellipses
Re: tableView column ellipses
- Subject: Re: tableView column ellipses
- From: Brian Webster <email@hidden>
- Date: Fri, 21 Nov 2003 00:11:42 -0600
One way to do it would be to create the attributed string as you did
below in your table data source method for returning object values for
that column. If you return an NSAttributedString as the object value
for the cell, it should display the string with all its attributes.
BTW, I believe the "..." button in IB is actually "---" and indicates
the text will be justified to both the left and right hand sides of the
cell.
On Nov 20, 2003, at 8:12 PM, Jesse Grosjean wrote:
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.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.