• 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: word-wrap in cells of an NSTableView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >word-wrap in cells of an NSTableView? (From: "Steven D.Arnold" <email@hidden>)
 >Re: word-wrap in cells of an NSTableView? (From: cricket <email@hidden>)

  • Prev by Date: Re: DistributedObjects, threads, sharing NSData
  • Next by Date: Re: Cocoa volume knob control?
  • Previous by thread: Re: word-wrap in cells of an NSTableView?
  • Next by thread: Loading fonts with kATSFontContextGlobal
  • Index(es):
    • Date
    • Thread