• 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
Re: tableView column ellipses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: tableView column ellipses
      • From: Brian Webster <email@hidden>
  • Prev by Date: DragRef/Clipboard flavors vs NSPasteboard types
  • Next by Date: Re: Don't leak memory!!
  • Previous by thread: Re: tableView column ellipses
  • Next by thread: Re: tableView column ellipses
  • Index(es):
    • Date
    • Thread