I have a NSTextView 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to