Re: [SOLVED] vertically resize NSTextField frame
Re: [SOLVED] vertically resize NSTextField frame
- Subject: Re: [SOLVED] vertically resize NSTextField frame
- From: Rob Napier <email@hidden>
- Date: Tue, 29 Apr 2008 10:50:33 -0400
Check the archives from a couple of weeks ago:
http://www.cocoabuilder.com/archive/message/cocoa/2008/4/17/204483
-Rob
--
Rob Napier -- Software and Security Consulting -- http://robnapier.net
On Apr 22, 2008, at 1:19 AM, Stuart Malin wrote:
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