• 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: Ben Robinson <email@hidden>
  • Date: Thu, 20 Dec 2007 23:19:11 +0000

I'm trying to put up an alert in a custom window (NSAlert won't work!)
- The alert message could be any length, but for the life of me I
can't figure out how to resize the label to the size of the text.

It's not clear whether you want a text field that sizes only in one dimension or if it's okay that it sizes both height and / or width as needed. If the latter, the -sizeToFit method is your best bet.

 If the former, this is a FAQ (please search the archives before
posting) which usually leads to one of these:

http://www.cocoadev.com/index.pl?CCDGrowingTextField
http://www.cocoadev.com/index.pl?IFVerticallyExpandingTextField

--
I.S.


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!!

The window will keep the same width, just grow in height, also my text box is a none editable label that I need to size as the alert opens, and only then (as apposed to growing as it's edited) - So I'm thinking (hoping) it should be possible it a couple of lines!

Thanks.

Ben.

_______________________________________________

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: Martin Wierschin <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>)

  • Prev by Date: Re: NSAnimation crashing on Leopard;;
  • Next by Date: When are objects from a core data store initially fetched?
  • Previous by thread: Re: NSTextField Size
  • Next by thread: Re: NSTextField Size
  • Index(es):
    • Date
    • Thread