Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< 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


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.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice