ftp.nice.ch/peanuts/GeneralData/Documents/openstep/OpenStepSpec_rtf.tar.gz#/OpenStepSpec_rtf/ApplicationKit/Classes/NSTextField.rtf

This is NSTextField.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc.  All Rights Reserved.

s4 li100 fi0 ri1007 ql f0 b fs36 fs100 
fs36 NSTextField 
pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSControl : NSView : NSResponder : NSObject
fs20 
fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding (NSResponder)
fi0 NSObject (NSObject)
fs20 
fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 AppKit/NSTextField.h 
fs20 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 
fs28 Class Description
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 An NSTextField is an NSControl object that can display a piece of text that a user can select or edit, and which sends an action message to its target if the user hits the Return key while editing. An NSTextField can also be linked to other NSTextFields, so that when the user presses Tab or Shift-Tab, the object assigned as the 'aanext'ba or 'aaprevious'ba field gets a message to select its text.
fs16 
fs28 An NSTextField is a good alternative to an NSText object for small regions of editable text, since the display of the NSTextField is achieved by using a global NSText object shared by objects all over your application, which saves on memory usage. Each NSWindow also has an NSText object used for editing of NSTextFields (and NSTextFieldCells in NSMatrices). An NSWindow'27s global NSText object is called a i field editori0 , since it'27s attached as needed to an NSTextField to perform its editing. NSTextField allows you to specify an object to act as an indirect delegate to the field editor; the NSTextField itself acts as the NSText delegate if it needs to, then passes the delegate method on to its own NSText delegate.
fs16 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 
fs28 Setting User Access to Text 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (BOOL)b isEditableb0 tab Returns whether the NSTextField'27s text is editable. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isSelectableb0 tab Returns whether the NSTextField'27s text is selectable. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setEditable:b0 (BOOL)i flagi0 tab Sets whether the NSTextField'27s text is editable. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setSelectable:b0 (BOOL)i flagi0 tab Sets whether the NSTextField's text is selectable. 
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Editing Text 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b selectText:b0 (id)i senderi0 tab Selects all of the text if it'27s selectable or editable. 
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Setting Tab Key Behavior 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (id)b nextTextb0 tab Gets the object selected when the user presses Tab. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (id)b previousTextb0 tab Gets the object selected when the user presses Shift-Tab. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setNextText:b0 (id)i anObjecti0 tab Sets the object selected when the user presses Tab. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setPreviousText:b0 (id)i anObjecti0 tab Sets the object selected when the user presses Shift-Tab. 
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Assigning a Delegate 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b setDelegate:b0 (id)i anObjecti0 tab Sets the delegate for messages from the field editor to i anObjecti0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (id)b delegateb0 tab Returns the delegate for messages from the field editor.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Modifying Graphic Attributes 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSColor *)b backgroundColorb0 tab Returns the color of the background.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b drawsBackgroundb0 tab Returns whether the NSTextField draws its own background.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isBezeledb0 tab Returns whether the NSTextField has a bezeled border. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isBorderedb0 tab Returns whether the NSTextField has a plain border. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setBackgroundColor:b0 (NSColor *)i aColori0 tab Sets the color of the background to i aColor.i0  
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setBezeled:b0 (BOOL)i flagi0 tab Sets whether the NSTextField has a bezeled border. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setBordered:b0 (BOOL)i flagi0 tab Sets whether the NSTextField has a plain border. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setDrawsBackgroundb0 :(BOOL)i flagi0 tab Sets whether the NSTextField draws its own background color. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setTextColor:b0 (NSColor *)i aColori0 tab Sets the color of the NSTextField'27s text to i aColori0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSColor *)b textColorb0 tab Returns the color of the NSTextField'27s text.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Target and Action 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (SEL)b errorActionb0 tab Returns the action method sent for an invalid value. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setErrorAction:b0 (SEL)i aSelectori0 tab Sets the action method sent (i aSelectori0 ) for an invalid value entered. 
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Handling Events 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (BOOL)b acceptsFirstResponderb0 tab Return YES if text is editable or selectable. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b textDidBeginEditing:b0 (NSNotification *)i notification
s9 li7030 fi-6553 fi-5796 i0 tab Invoked when there'27s a change in the text after the receiver gains first responder status. The default behavior is to pass this message on to the text delegate by posting the notification NSControlTextDidEndEditingNotification with the receiving object and, in the notification'27s dictionary, the text object (with the key NSFieldEditor) to the default notification center.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b textDidChange:b0 (NSNotification *)i notificationi0 tab 
s9 li7030 fi-6553 fi-5796 tab Invoked upon a key-down event or paste operation that changes the receiver'27s contents. The default behavior is to pass this message on to the text delegate by posting the NSControlTextDidChangeNotification notification with the receiving object and, in the notification'27s dictionary, the text object (with the key NSFieldEditor) to the default notification center.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b textDidEndEditing:b0 (NSNotification *)i notification
s9 li7030 fi-6553 fi-5796 i0 i tab i0 Invoked when text editing ends. The default behavior is to pass this message on to the text delegate by posting the notification NSControlTextDidEndEditingNotification with the receiving object and, in the notification'27s dictionary, the text object (with the key NSFieldEditor) to the default notification center.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b textShouldBeginEditing:b0 (NSText *)i textObjecti0 tab  
s9 li7030 fi-6553 fi-5796 tab Invoked to let the NSTextField respond to impending changes to its text and then forwarded to the text delegate.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b textShouldEndEditing:b0 (NSText *)i textObjecti0 tab 
s9 li7030 fi-6553 fi-5796 tab Invoked to let the NSTextField respond to impending loss of first responder status and then forwarded to the text delegate.
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.