• 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: How to compute optimal NSField size?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to compute optimal NSField size?


  • Subject: Re: How to compute optimal NSField size?
  • From: Leon Starr <email@hidden>
  • Date: Mon, 18 Jun 2007 13:14:18 -0700

Thanks for pointing me in the right direction! This looks like it will work.

- Leon Starr

On Jun 17, 2007, at 1:26 PM, I. Savant wrote:

On Jun 17, 2007, at 3:47 PM, Leon Starr wrote:
I am trying to figure out how to set the frame size of a field based on the quantity of entered
text. Let's say the field can store a maximum of 40 characters, but typically holds only 10-15
characters. If there is a small amount of text, I would like the field frame to be the "small size".
But if the user enters 30 chars, I would like to resize the field frame to the "big size".


In general, you could get the string value, then use the - sizeWithAttributes: string method to figure out its size with the field's attributes (font), or whatever attributes you want. Then you can adjust the field's frame as needed.

--
I.S.




_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >How to compute optimal NSField size? (From: Leon Starr <email@hidden>)
 >Re: How to compute optimal NSField size? (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: text to bezier path
  • Next by Date: Re: text to bezier path
  • Previous by thread: Re: How to compute optimal NSField size?
  • Next by thread: Bizarre crashing bug
  • Index(es):
    • Date
    • Thread