Re: Metrics for a NSTextField
Re: Metrics for a NSTextField
- Subject: Re: Metrics for a NSTextField
- From: Martin Wierschin <email@hidden>
- Date: Tue, 24 Feb 2009 17:39:26 -0800
Hi Eric,
NSTextView *fieldEditor = (NSTextView*)[[self window]
fieldEditor:YES forObject:self];
NSRect usedRect = [[fieldEditor layoutManager]
usedRectForTextContainer:[fieldEditor textContainer]];
But the used rect returned is empty and [self stringValue] does
contain a string of > 0 characters.
If you check the documentation for the "usedRectForTextContainer:"
method, it does not trigger any layout. So you'll want to first call
something like "ensureLayoutForTextContainer:" before asking your
question.
~Martin
_______________________________________________
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