• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Making a window fit its contents?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a window fit its contents?


  • Subject: Re: Making a window fit its contents?
  • From: Nick Toumpelis <email@hidden>
  • Date: Mon, 31 Mar 2008 11:33:34 +0300

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:
This email sent to email@hidden


References: 
 >Making a window fit its contents? (From: Jack Repenning <email@hidden>)

  • Prev by Date: Rotating a bunch of images
  • Next by Date: How to programming 'drag to Application' action?
  • Previous by thread: Making a window fit its contents?
  • Next by thread: Modify Input in NSTableView
  • Index(es):
    • Date
    • Thread