Contents

NSText

The most general programmatic interface for objects that manage text.

Declaration

class NSText

Overview

NSText draws text for user interface objects, provides text editing capabilities, and controls text attributes such as type size, font, and color.

NSText initialization creates an instance of a concrete subclass, such as NSTextView (generically called a text object). In general, you’re more likely to use the NSTextView subclass, because it extends the interface declared by NSText and provides much more sophisticated functionality than that declared in NSText.

AppKit uses text objects wherever text appears in interface objects. For example, a text object draws the title of a window, the commands in a menu, the title of a button, and the items in a browser. Your app can also create text objects for its own purposes.

Topics

Creating a Text Object

Getting the characters

Setting graphics attributes

Setting behavioral attributes

Using the Font panel and menu

Using the ruler

Changing the selection

Replacing text

Action methods for editing

Changing the font

Setting text alignment

Setting text color

Writing direction

Setting superscripting and subscripting

Underlining text

Reading and writing RTF files

Checking spelling

Constraining size

Scrolling

Setting the delegate

Constants

Notifications

See Also

Text views