• 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: number of rows for an attributed string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: number of rows for an attributed string


  • Subject: Re: number of rows for an attributed string
  • From: Jayson Adams <email@hidden>
  • Date: Wed, 21 Nov 2007 11:37:24 -0800


On Nov 21, 2007, at 10:53 AM, Mitchell Livingston wrote:

This works to determine the height and width, but I want to know what the height is when the width is restricted to a certain value.

For that, I would use an NSTextView to compute the height. Something like:


[[tmpTextView textContainer] setContainerSize:NSMakeSize (theWidth, 1e7)];

    [tmpTextView setMinSize:NSMakeSize(theWidth, 1.0)];
    [tmpTextView setMaxSize:NSMakeSize(theWidth, 1e7)];
    [tmpTextView setHorizontallyResizable:YES];
    [tmpTextView setVerticallyResizable:YES];

    [tmpTextView sizeToFit];

    theHeight = [tmpTextView bounds].size.height;

Best,


__jayson

Circus Ponies NoteBook - Organization for a Creative Mind
www.circusponies.com



_______________________________________________

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


References: 
 >number of rows for an attributed string (From: Mitchell Livingston <email@hidden>)
 >Re: number of rows for an attributed string (From: Jayson Adams <email@hidden>)
 >Re: number of rows for an attributed string (From: Mitchell Livingston <email@hidden>)

  • Prev by Date: Re: CoverFlow
  • Next by Date: Re: find display type
  • Previous by thread: Re: number of rows for an attributed string
  • Next by thread: find display type
  • Index(es):
    • Date
    • Thread