• 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: Metrics for a NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Metrics for a NSTextField (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: Editing a multi-line NSTextField as a single line
  • Next by Date: Re: [Q] What causes an NSArrayController to know that an entity was inserted via a different window?
  • Previous by thread: Metrics for a NSTextField
  • Next by thread: Re: Metrics for a NSTextField
  • Index(es):
    • Date
    • Thread