• 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: Vincent Habchi <email@hidden>
  • Date: Mon, 8 Nov 2010 12:21:06 +0100

Le 8 nov. 2010 à 09:55, Micha Fuhrmann a écrit :

> 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.

Assuming that "font" is a NSFont * ivar on the font your using, and stringLength the length of your NSString,

size = stringLength * [font maximumAdvancement].width;

will return you the largest size, in pixels, for a string of stringLength chars.

Vincent _______________________________________________

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

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

  • Prev by Date: Re: Mock the internet
  • Next by Date: Re: NSTextFieldCell multi-line
  • Previous by thread: NSTextFieldCell multi-line
  • Next by thread: Re: NSTextFieldCell multi-line
  • Index(es):
    • Date
    • Thread