• 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: NSTextField & Vertical resizing using sizeToFit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField & Vertical resizing using sizeToFit


  • Subject: Re: NSTextField & Vertical resizing using sizeToFit
  • From: Eric Gorr <email@hidden>
  • Date: Wed, 10 Nov 2010 14:58:08 -0500

Sorry...I mean NSTextField.

On Nov 10, 2010, at 2:47 PM, Eric Gorr wrote:

> I have a NSTextField and I would like it to calculate for me how tall it needs to be to contain the string I assigned to it. I have set the width to 200  pixels and the initial height of the field to CGFLOAT_MAX. I then do:
>
> 		[[theField cell] setLineBreakMode:NSLineBreakByWordWrapping];
> 		[[theField cell] setWraps:YES];
> 		[theField sizeToFit];
>
> However, when I get the frame back again, it has resized it in the horizontal direction only. Now, I believe calling setLineBreakMode and setWraps is redundant, but I am still clearly missing something that would cause the control to resizing vertically instead of horizontally. What am I missing?
>
> Thank you.

_______________________________________________

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: 
 >NSTextView & Vertical resizing using sizeToFit (From: Eric Gorr <email@hidden>)

  • Prev by Date: NSTextView & Vertical resizing using sizeToFit
  • Next by Date: Re: Cocoa-dev Digest, Vol 7, Issue 1044
  • Previous by thread: NSTextView & Vertical resizing using sizeToFit
  • Next by thread: NSTextView vs NSTextField
  • Index(es):
    • Date
    • Thread