Name
NSTextField — Mac OS X 10.0
Synopsis
This control class implements an editable text entry and display
field. NSTextField’s companion
cell class is NSTextFieldCell, a subclass of
NSActionCell. Thus, NSTextField
is capable of sending action messages to targets. By default, actions
are sent to targets when the user completes editing by pressing the
Return key.
Accessing the value of a text field is done using methods inherited
from NSControl (indeed, these are the methods used
to access the values of any control). To get the contents of the text
field as a string, invoke stringValue.
Alternatively, we may take the value as a number using
intValue, floatValue, and
doubleValue. Each of these methods has a
corresponding set... method used to change the
value displayed in the text field. See NSControl
(earlier in this chapter) for more information.
|
|
@interface NSTextField : NSControl
|
// Accessor Methods
|
- (void)setDelegate:(id)anObject; |
- (id)delegate;
|
- (void)setImportsGraphics:(BOOL)flag; |
- (BOOL)importsGraphics;
|
- (void)setSelectable:(BOOL)flag; |
- (void)setBordered:(BOOL)flag; |
- (void)setBezeled:(BOOL)flag; |
- (void)setAllowsEditingTextAttributes:(BOOL)flag; |
- (BOOL)allowsEditingTextAttributes;
|
- (void)setBackgroundColor:(NSColor *)color; |
- (NSColor *)backgroundColor;
|
- (void)setBezelStyle:(NSTextFieldBezelStyle)style; |
- (NSTextFieldBezelStyle)bezelStyle ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access