Re: NSTextField Size
Subject : Re: NSTextField Size
From: Martin Wierschin <email@hidden >
Date: Thu, 20 Dec 2007 16:51:25 -0800
Delivered-to: email@hidden
Delivered-to: email@hidden
I've started to have a good look at those links and am trying to
extract the stuff I need, I suppose I could try and use it
complete, but they seem over complicated!!
This should do the trick:
NSRect bounds = NSMakeRect( 0, 0, [textField frame].size.width,
99999 );
[textField setStringValue:message];
float requiredHeight = [[textField cell]
cellSizeForBounds:bounds].height;
(untested, typed in Mail)
~Martin
_______________________________________________
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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.