Re: Metrics for a NSTextField
Re: Metrics for a NSTextField
- Subject: Re: Metrics for a NSTextField
- From: Michael Ash <email@hidden>
- Date: Thu, 26 Feb 2009 11:10:49 -0500
On Thu, Feb 26, 2009 at 10:49 AM, Eric Gorr <email@hidden> wrote:
> Unfortunately, sizeToFit does not work.
>
> It doesn't appear one can constrain the width of a NSTextField and only have
> it's height adjustable. Basically, sizeToFit provides a size that causes the
> text in the field to fit on a single line.
Try sending -cellSizeForBounds: to your NSTextFieldCell. Give it a
bounds with the correct width but a very tall height, and it should
keep that width (or reduce it) and give you the appropriate height
with wrapping.
Mike
_______________________________________________
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