• 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: Used Size of Text View
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Used Size of Text View


  • Subject: Re: Used Size of Text View
  • From: Jeremy Dronfield <email@hidden>
  • Date: Tue, 17 Feb 2004 21:51:50 +0000

Try [[myTextView textStorage] size] which returns the bounds of the drawn text.
-Jeremy

On 17 Feb 2004, at 7:54 pm, Francisco Tolmasky wrote:

Is there any way to get the size of the used portion of a text view, without using the nslayoutmanager to calculate it each time. I will probably be querying it after text insertion so I would like it to be fast. Basically I just want to know when a new line is needed (either because of a text wrap or because of an actual newline insertion). Unfortunately, [textView frame].size.height is the height of the view even if the text takes up less space and [[textView textContainer] containerSize].height always returns 1000000 or something like that since it needs to be big enough to keep fitting text. So is there a stored value somewhere, or will I have to calculate glyph sizes?

Thanks in advance,

Francisco Tolmasky
email@hidden
http://users.adelphia.net/~ftolmasky
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Used Size of Text View (From: Francisco Tolmasky <email@hidden>)

  • Prev by Date: Re: NSEnumerator doesn't support NSCopying - why?
  • Next by Date: TAB NSTextField in a NSView
  • Previous by thread: Used Size of Text View
  • Next by thread: How to make borderless window resizable
  • Index(es):
    • Date
    • Thread