• 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: NSTextFieldCell multi-line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextFieldCell multi-line


  • Subject: Re: NSTextFieldCell multi-line
  • From: "email@hidden" <email@hidden>
  • Date: Mon, 8 Nov 2010 12:32:00 +0000

On 8 Nov 2010, at 08:55, Micha Fuhrmann wrote:

> Dear All,
>
> I'm stuck here and it seems so trivial...
>
> I'm using NSTextFieldCell in a tableview and when the text takes the whole cell, the cell size doesn't resize and add a line (which I would expect!!!). Setting the text properties in NSCell doesn't cut it either. So I've tried using
>
> - (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row {
>
> But how can I compute the amount screen pixels my NSString that's going into the cell will take to return a height with the proper number of lines? I must be missing something, it's just too silly.
>
> Any help appreciated.
>
> Michael
>
>
For cell text wrapping behaviour see the NSCell documentation: -setLineBreakMode, -setWraps, -setTruncatesLastVisibleLine:

To get the required size try NSString  -sizeWithAttributes:

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTextFieldCell multi-line
      • From: Micha Fuhrmann <email@hidden>
References: 
 >NSTextFieldCell multi-line (From: Micha Fuhrmann <email@hidden>)

  • Prev by Date: Re: NSTextFieldCell multi-line
  • Next by Date: Calling getter on const object
  • Previous by thread: Re: NSTextFieldCell multi-line
  • Next by thread: Re: NSTextFieldCell multi-line
  • Index(es):
    • Date
    • Thread