Inherits From:
NSObject
Conforms To:
NSObject (NSObject)
Declared In:
AppKit/NSTextAttachment.h
A text attachment object contains an NSFileWrapper, which in turn holds the contents of the attached file. It also uses a cell object conforming to the NSTextAttachmentCell protocol to draw and handle mouse events. Most of the behavior of a text attachment is relegated to the file wrapper and the attachment cell. See the corresponding class and protocol specifications for more information.
attachmentCell
Returns the object used to draw the icon for the attachment and to handle mouse events. An NSTextAttachment by default uses an NSTextAttachmentCell that displays the attached file's icon, or its contents if the file contains an image.
See also:
- fileWrapper
, - image
(NSCell), - icon
(NSFileWrapper), - setAttachmentCell:
fileWrapper
Returns the receiver's file wrapper, which holds the contents of the attached file.
See also:
- setFileWrapper:
initWithFileWrapper:
(NSFileWrapper *)aWrapper
Initializes a newly allocated NSTextAttachment to contain aWrapper and to use an NSTextAttachmentCell as its attachment cell. If aWrapper contains an image file that the receiver can interpret as an NSImage object, it sets the attachment cell's image to the NSImage rather than to aWrapper's icon.
This method is the designated initializer for the NSTextAttachment class. Returns self
.
See also:
- setFileWrapper:
, - setAttachmentCell:
setAttachmentCell:
(id <NSTextAttachmentCell>)aCell
Sets the object used to draw the icon for the attachment and to handle mouse events to aCell.
See also:
- setFileWrapper:
, - setImage:
(NSCell), - icon
(NSFileWrapper), - attachmentCell
setFileWrapper:
(NSFileWrapper *)aWrapper
Sets the receiver's file wrapper, which holds the contents of the attached file, to aWrapper.
See also:
- fileWrapper