< Previous PageNext Page > Hide TOC

Displaying a Text Container

You normally use an NSTextView object to display the text laid out in an NSTextContainer. An NSTextView can have only one NSTextContainer; however, because the two are separate objects, you can replace an NSTextView’s container to change the layout of the text it displays. You can also display an NSTextContainer’s text in any NSView by locking the graphic focus on it with lockFocus: and using the NSLayoutManager methods drawBackgroundForGlyphRange:atPoint: and drawGlyphsForGlyphRange:atPoint:. If you have no need to actually display the text—if you’re only calculating line breaks or number of lines or pages, for example—you can use an NSTextContainer without an NSTextView.



< Previous PageNext Page > Hide TOC


© 1997, 2005 Apple Computer, Inc. All Rights Reserved. (Last updated: 2005-08-11)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.