Mailing Lists: Apple Mailing Lists

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

Re: Making a window fit its contents?



Hi Jack,

the most effective way to do this is by using Jerry Krinock's NS(Attributed)String+Geometrics categories [1]. Using this, you can determine the height or width of your text and size your window (and NSTextField) appropriately.

Nick

[1] http://sheepsystems.com/sourceCode



On 31 Μαρ 2008, at 9:06 ΠΜ, Jack Repenning wrote:

How can I [someNSTextField setStringValue:someString] (to some value I only learn at run time), and then resize the window that contains it so the string is visible? Or, is there something I can set in Interface Builder that will make this resize happen automatically?

I found a sizeToFit in the NSTextField, but not on the surrounding NSWindow or NSView.

Nick Toumpelis :: email:email@hidden




_______________________________________________

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
References: 
 >Making a window fit its contents? (From: Jack Repenning <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.