Up

# NSTextField

### Authors

Scott Christley (`scottc@net-community.com`)
Felipe A. Rodriguez (`far@ix.netcom.com`)
Nicola Pero (`n.pero@mi.flashnet.it`)

> Text field control class for text entry

Copyright: (C) 1996 Free Software Foundation, Inc.

### Contents -

1. Software documentation for the NSTextField class
2. Software documentation for the NSTextFieldDelegate protocol

# Software documentation for the NSTextField class

## NSTextField : NSControl

> Declared in:
>   AppKit/NSTextField.h

Availability: OpenStep
Description forthcoming.

Instance Variables
Method summary

- -acceptsFirstResponder
- -allowsEditingTextAttributes
- -backgroundColor
- -bezelStyle
- -delegate
- -drawsBackground
- -errorAction
- -importsGraphics
- -isBezeled
- -isBordered
- -isEditable
- -isSelectable
- -nextText
- -previousText
- -selectText:
- -setAllowsEditingTextAttributes:
- -setBackgroundColor:
- -setBezelStyle:
- -setBezeled:
- -setBordered:
- -setDelegate:
- -setDrawsBackground:
- -setEditable:
- -setErrorAction:
- -setImportsGraphics:
- -setNextText:
- -setPreviousText:
- -setSelectable:
- -setTextColor:
- -setTitleWithMnemonic:
- -textColor
- -textDidBeginEditing:
- -textDidChange:
- -textDidEndEditing:
- -textShouldBeginEditing:
- -textShouldEndEditing:

### acceptsFirstResponder

- (BOOL) acceptsFirstResponder;
Availability: OpenStep

Returns whether the NSTextField accepts to be the first responder. This method returns `YES` if the NSTextField is selectable and if there is no NSText object

See Also: -becomeFirstResponder -isSelectable [NSView -acceptsFirstResponder]

### allowsEditingTextAttributes

- (BOOL) allowsEditingTextAttributes;
Availability: MacOS-X 10.0.0
Description forthcoming.

### backgroundColor

- (NSColor*) backgroundColor;
Availability: OpenStep

Returns the color used to draw the background.

See Also: -setBackgroundColor: setDrawsBackground: -drawsBackground [NSTextFieldCell -backgroundColor]

### bezelStyle

- (NSTextFieldBezelStyle) bezelStyle;
Availability: MacOS-X 10.2.0
Description forthcoming.

### delegate

- (id<NSTextFieldDelegate>) delegate;
Availability: OpenStep

Returns the delegate object.

See Also: -setDelegate:

### drawsBackground

- (BOOL) drawsBackground;
Availability: OpenStep

Returns whether the NSTextField draws the background. By default `NO`.

See Also: -setDrawsBackground: [NSTextFieldCell -drawsBackground]

### errorAction

- (SEL) errorAction;
Availability: OpenStep
Description forthcoming.

### importsGraphics

- (BOOL) importsGraphics;
Availability: MacOS-X 10.0.0
Description forthcoming.

### isBezeled

- (BOOL) isBezeled;
Availability: OpenStep

Returns whether the NSTextField's cell has bezeled border.

See Also: -setBezeled: [NSTextFieldCell -isBezeled]

### isBordered

- (BOOL) isBordered;
Availability: OpenStep

Returns whether the NSTextField's cell has border.

See Also: -setBordered: [NSTextFieldCell -isBordered]

### isEditable

- (BOOL) isEditable;
Availability: OpenStep

Returns whether the NSTextField is editable. By default a NSTextField is not editable.

See Also: -setEditable: [NSCell -isEditable]

### isSelectable

- (BOOL) isSelectable;
Availability: OpenStep

Returns whether the NSTextField is selectable.

See Also: -setSelectable: [NSCell -isSelectable]

### nextText

- (id) nextText;
Availability: OpenStep

Returns the object selected when the user presses the TAB key.

See Also: -setNextText: [NSView -nextKeyView]

### previousText

- (id) previousText;
Availability: OpenStep

Returns the object selected when the user presses the Shift-TAB key.

See Also: -setPreviousText: [NSView -previousKeyView]

### selectText:

- (void) selectText: (id)sender;
Availability: OpenStep

Selects all the text of the NSTextField if it's selectable.

### setAllowsEditingTextAttributes:

- (void) setAllowsEditingTextAttributes: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setBackgroundColor:

- (void) setBackgroundColor: (NSColor*)aColor;
Availability: OpenStep

Sets the color used to draw the background to aColor.

See Also: -backgroundColor -setDrawsBackground: -drawsBackground [NSTextFieldCell -setBackgroundColor:]

### setBezelStyle:

- (void) setBezelStyle: (NSTextFieldBezelStyle)style;
Availability: MacOS-X 10.2.0
Description forthcoming.

### setBezeled:

- (void) setBezeled: (BOOL)flag;
Availability: OpenStep

Sets whether the NSTextField's cell has bezeled border.

See Also: -isBezeled [NSTextFieldCell -setBezeled:]

### setBordered:

- (void) setBordered: (BOOL)flag;
Availability: OpenStep

Sets whether the NSTextField's cell has border.

See Also: -isBordered [NSTextFieldCell -setBordered:]

### setDelegate:

- (void) setDelegate: (id<NSTextFieldDelegate>)anObject;
Availability: OpenStep

Sets the delegate to anObject.

See Also: -delegate

### setDrawsBackground:

- (void) setDrawsBackground: (BOOL)flag;
Availability: OpenStep

Sets whether the NSTextField draws the background. By default `NO`.

See Also: -drawsBackground [NSTextFieldCell -setDrawsBackground:]

### setEditable:

- (void) setEditable: (BOOL)flag;
Availability: OpenStep

Sets whether the NSTextField's cell and the NSText object is editable. By default a NSTextField is not editable.

See Also: -isEditable [NSCell -setEditable:] [NSText -setEditable:]

### setErrorAction:

- (void) setErrorAction: (SEL)aSelector;
Availability: OpenStep
Description forthcoming.

### setImportsGraphics:

- (void) setImportsGraphics: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setNextText:

- (void) setNextText: (id)anObject;
Availability: OpenStep

Sets the object selected when the user presses the TAB key to anObject.

See Also: -nextText [NSView -setNextKeyView:]

### setPreviousText:

- (void) setPreviousText: (id)anObject;
Availability: OpenStep

Sets the object selected when the user presses the shift-TAB key to anObject.

See Also: -previousText [NSView -setPreviousKeyView:]

### setSelectable:

- (void) setSelectable: (BOOL)flag;
Availability: OpenStep

Sets whether the NSTextField's cell and the NSText object is selectable.

See Also: -isSelectable [NSTextFieldCell -setSelectable:] [NSText -setSelectable:]

### setTextColor:

- (void) setTextColor: (NSColor*)aColor;
Availability: OpenStep

Sets the color with which the text will be draw to aColor.

See Also: -textColor [NSTextFieldCell -setTextColor:]

### setTitleWithMnemonic:

- (void) setTitleWithMnemonic: (NSString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.

### textColor

- (NSColor*) textColor;
Availability: OpenStep

Returns the colour used to draw the text.

See Also: -setTextColor: [NSTextFieldCell -textColor]

### textDidBeginEditing:

- (void) textDidBeginEditing: (NSNotification*)aNotification;
Availability: OpenStep
Description forthcoming.

### textDidChange:

- (void) textDidChange: (NSNotification*)aNotification;
Availability: OpenStep
Description forthcoming.

### textDidEndEditing:

- (void) textDidEndEditing: (NSNotification*)aNotification;
Availability: OpenStep
Description forthcoming.

### textShouldBeginEditing:

- (BOOL) textShouldBeginEditing: (NSText*)textObject;
Availability: OpenStep
Description forthcoming.

### textShouldEndEditing:

- (BOOL) textShouldEndEditing: (NSText*)textObject;
Availability: OpenStep
Description forthcoming.

## Instance Variables for NSTextField Class

### _delegate

@protected id _delegate;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _error_action

@protected SEL _error_action;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _text_object

@protected NSText* _text_object;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

# Software documentation for the NSTextFieldDelegate protocol

## NSTextFieldDelegate

> Declared in:
>   AppKit/NSTextField.h

> Conforms to:
>   NSControlTextEditingDelegate

Availability: OpenStep
Description forthcoming.
Up