Re: Used Size of Text View
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.