Platforms to show: All Mac Windows Linux Cross-Platform
NSTextAttachmentMBS class
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| class | Cocoa Text | MBS MacBase Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSTextAttachment objects are used by the NSAttributedString class cluster as the values for attachment attributes (stored in the attributed string under the key named NSAttachmentAttributeName). The objects you create with this class are referred to as text attachment objects, or when no confusion will result, as text attachments or merely attachments.
A text attachment object contains an NSFileWrapper in NSFileWrapper Class Reference object, which in turn holds the contents of the attached file. It also uses a cell object conforming to the NSTextAttachmentCell in NSTextAttachmentCell Protocol Reference 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.
See the NSAttributedString in NSAttributedString Class Reference and NSTextView in NSTextView Class Reference class specifications for general information on text attachments.
see also
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTextAttachment_Class/index.html#//apple_ref/occ/instm/NSTextAttachment/initWithFileWrapper:
- 7 properties
- property attachmentCell as Variant
- property bounds as NSRectMBS New in 26.2
- property contents as MemoryBlock New in 26.2
- property fileType as String New in 26.2
- property fileWrapper as NSFileWrapperMBS
- property Handle as Integer
- property image as NSImageMBS New in 26.2
- 2 methods
- method Constructor(fileWrapper as NSFileWrapperMBS)
- method Constructor(image as NSImageMBS)
- shared method attributedStringWithAttachment(attachment as NSTextAttachmentMBS) as NSAttributedStringMBS
Constants
| Constant | Value | Description |
|---|---|---|
| NSAttachmentCharacter | &hFFFC | This character is used to denote an attachment. Example |
This class has no sub classes.
Blog Entries
- MBS Xojo Plugins, version 26.2pr2
- RTF functions in MBS Plugins
- MBS Xojo / Real Studio Plugins, version 15.1pr4
- MonkeyBread Software Releases the MBS Xojo / Real Studio plug-ins in version 15.0
- MBS Xojo / Real Studio Plugins, version 14.5pr4
Release notes
- Version 26.2
- Updated NSTextAttachmentMBS constructor taking picture to use newer APIs.
- Added more properties for NSTextAttachmentMBS class.
Some methods using this class:
- NSAttributedStringMBS.attributedStringWithAttachment(attachment as NSTextAttachmentMBS) as NSAttributedStringMBS
Some examples using this class:
Some related classes:
The items on this page are in the following plugins: MBS MacBase Plugin.