Re: NSTextFieldCell multi-line
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