[SOLVED] vertically resize NSTextField frame
[SOLVED] vertically resize NSTextField frame
- Subject: [SOLVED] vertically resize NSTextField frame
- From: Stuart Malin <email@hidden>
- Date: Mon, 21 Apr 2008 19:19:11 -1000
After poking around some more, I came up with this approach, which
seems to work
(except that I now have to deal with adjusting the text field's origin):
NSRect r = NSMakeRect(0, 0, [theTextField frame].size.width,
MAXFLOAT);
NSSize s = [[theTextField cell] cellSizeForBounds:r];
[theTextField setFrameSize:s];
If there is a better way to be doing this, please advise.
On Apr 21, 2008, at 6:06 PM, email@hidden wrote:
Message: 16
Date: Mon, 21 Apr 2008 18:03:30 -1000
From: Stuart Malin <email@hidden>
Subject: vertically resize NSTextField frame
To: Cocoa Developer List <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
I have an NSTextField into which I pour some text. I'd like to resize
the text field's frame to accommodate the typeset text. I'd like to
adjust only the frame's vertical size, leaving the width fixed. I'd
appreciate any pointers about what methods I can use to accomplish
this.
_______________________________________________
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