Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] vertically resize NSTextField frame



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:
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.