Re: number of rows for an attributed string
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