Re: NSTextField(?) Dynamic size based on content
Re: NSTextField(?) Dynamic size based on content
- Subject: Re: NSTextField(?) Dynamic size based on content
- From: otherguy <email@hidden>
- Date: Fri, 27 Feb 2004 02:50:16 -0700
Thanks for the FYI on the Cocoa-dev list.
It's really not for input so much as it to establish minimum field
length in case my container view gets resized.
I really appreciate the help, thank you.
-Cameron Wilhelm
On Feb 27, 2004, at 2:02 AM, j o a r wrote:
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.
_______________________________________________
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.