Re: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value
Re: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value
- Subject: Re: [BUG?] - [NSLayoutManager usedRectForTextContainer:] returns incorrect value
- From: Benjamin Stiglitz <email@hidden>
- Date: Mon, 30 Mar 2009 09:55:41 -0400
- Mail-followup-to: email@hidden
> I'm running the code below. I have a single NSWindow with a checkbox and
> a button. In the awakeFromNib method of the main controller, I change the
> attribute of the checkbox string. In the compute: method, I compute the
> height requested to display a string for a specific font and maximum
> width.
>
> If I run this code as is, I get 17.0 as the required height. That's
> incorrect.
>
> If I comment the awakeFromNib code, I get 34.0f as the required height.
> That's correct.
Is this the code exactly as it is in the app? e.g. compute: doesn't
depend in any way on the values you set in -awakeFromNib? (I think this
is your complaint, but I'm just verifying.)
Not that this fixes your problem, but
-[NSAttributedString boundingRectWithSize:options:] would probably be a
bit easier for you to use.
-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