• 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: NSTextField Size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField Size


  • Subject: Re: NSTextField Size
  • From: Martin Wierschin <email@hidden>
  • Date: Thu, 20 Dec 2007 16:51:25 -0800

I've started to have a good look at those links and am trying to extract the stuff I need, I suppose I could try and use it complete, but they seem over complicated!!

This should do the trick:

NSRect bounds = NSMakeRect( 0, 0, [textField frame].size.width, 99999 );
[textField setStringValue:message];
float requiredHeight = [[textField cell] cellSizeForBounds:bounds].height;


(untested, typed in Mail)

~Martin

_______________________________________________

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


  • Follow-Ups:
    • Re: NSTextField Size
      • From: Ben Robinson <email@hidden>
References: 
 >parsing string data (From: "C Sandeep" <email@hidden>)
 >Re: parsing string data (From: j o a r <email@hidden>)
 >Re: parsing string data (From: "C Sandeep" <email@hidden>)
 >NSTextField Size (From: Ben Robinson <email@hidden>)
 >Re: NSTextField Size (From: "I. Savant" <email@hidden>)
 >Re: NSTextField Size (From: Ben Robinson <email@hidden>)

  • Prev by Date: Re: How to implement an array of dicts
  • Next by Date: Re: How to implement an array of dicts
  • Previous by thread: Re: NSTextField Size
  • Next by thread: Re: NSTextField Size
  • Index(es):
    • Date
    • Thread