• 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(?) Dynamic size based on content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField(?) Dynamic size based on content


  • Subject: Re: NSTextField(?) Dynamic size based on content
  • From: j o a r <email@hidden>
  • Date: Fri, 27 Feb 2004 10:02:07 +0100

FYI. I think that this is more of a Cocoa-Dev question than a
Xcode-Users question.

I don't think that Apple is using text fields for the AB. They are
using some sort of funky hack with a text view. From a usability point
of view I don't think that this is something you should try to emulate,
as this custom text view doesn't behave like any other standard
control.

If you want to find the size of a string, use the size methods
available in either NSAttributedString ("size") or NSString
("sizeWithAttributes:").

j o a r

On 2004-02-27, at 08.56, otherguy wrote:

> I need to do something similar to what Apple's done with Address Book
> and the fields while they're in edit mode.  Specifically how the
> fields dynamically grow as you type into them.  I was trying to figure
> out how to do this with a NSTextField, but I cannot, for the life of
> me, find any information on how to calculate the width in pixels of a
> formatted string of text.
>
> Would someone be kind enough to point me in the right direction?  If I
> should be using a NSTextView instead, is there a way to set the
> border, or do I have to create a subclass or composite class?  If I
> can do it with a NSTextField, does anyone know how to calculate the
> proper width?
>
> I've been plowing through several cocoa books on O'Reilly's Safari as
> well as the Apple Documentation.  Any recommendations for additional
> resources are extremely welcome.

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSTextField(?) Dynamic size based on content
      • From: otherguy <email@hidden>
References: 
 >NSTextField(?) Dynamic size based on content (From: otherguy <email@hidden>)

  • Prev by Date: Re: Breakpoints not working
  • Next by Date: Re: NSTextField(?) Dynamic size based on content
  • Previous by thread: NSTextField(?) Dynamic size based on content
  • Next by thread: Re: NSTextField(?) Dynamic size based on content
  • Index(es):
    • Date
    • Thread