Platforms to show: All Mac Windows Linux Cross-Platform
NSPasteboardItemMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Clipboard | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
There are three main uses for an NSPasteboardItem object:
Providing data on the pasteboard.
You can create one or more pasteboard items, set data or data providers for types, and write to them pasteboard.
Customizing data already on the pasteboard.
As a delegate or subclass, you can retrieve the pasteboard items currently on the pasteboard, read the existing types and data and set new data and data providers for types as needed.
Retrieving data from the pasteboard.
You can retrieve pasteboard items from the pasteboard then read the data for types you're interested in.
A pasteboard item can be associated with a single pasteboard. When you create an item, it can be written to any pasteboard. When you pass an item to a pasteboard in writeObjects, that item becomes bound to the pasteboard it was written to. When you retrieve items from a pasteboard using pasteboardItems, the returned items are associated with the messaged pasteboard. Passing an item that is already associated with a pasteboard into writeObjects: causes an exception to be raised.
Pasteboard items are intended to be used during a single pasteboard interaction, not held onto and used repeatedly. A pasteboard item is only valid until the owner of the pasteboard changes.
Important: If a pasteboard item is stale because the pasteboard owner has changed, it returns nil or false values from its methods.
- 5 properties
- property dataProvider as NSPasteboardItemDataProviderMBS
- property Handle as Integer
- property dataForType(type as string) as memoryblock
- property propertyListForType(type as string) as Variant
- property stringForType(type as string) as string
- 5 methods
- method availableTypeFromArray(types() as string) as string
- method Constructor
- method Destructor
- method setDataProviderForType(dataProvider as NSPasteboardItemDataProviderMBS, types() as string) as boolean
- method types as string()
This class has no sub classes.
Some methods using this class:
- NSDraggingItemMBS.Constructor(item as NSPasteboardItemMBS)
- NSPasteboardMBS.pasteboardItems as NSPasteboardItemMBS()
- NSPasteboardMBS.SetPasteboardItems(items() as NSPasteboardItemMBS) as Boolean
Some events using this class:
- DesktopNSCollectionViewControlMBS.pasteboardWriterForItem(indexPath as NSIndexPathMBS) as NSPasteboardItemMBS
- DesktopNSOutlineControlMBS.pasteboardWriterForItem(item as NSOutlineViewItemMBS) as NSPasteboardItemMBS
- DesktopNSTableControlMBS.pasteboardItemForRow(row as Integer) as NSPasteboardItemMBS
- NSCollectionViewControlMBS.pasteboardWriterForItem(indexPath as NSIndexPathMBS) as NSPasteboardItemMBS
- NSOutlineControlMBS.pasteboardWriterForItem(item as NSOutlineViewItemMBS) as NSPasteboardItemMBS
- NSPasteboardItemDataProviderMBS.provideDataForType(Pasteboard as NSPasteboardMBS, item as NSPasteboardItemMBS, type as string)
- NSTableControlMBS.pasteboardItemForRow(row as Integer) as NSPasteboardItemMBS
Some examples using this class:
- /MacCocoa/Custom NSViewControl Drag
- /MacControls/Custom NSView Drag
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
- /MacControls/Listbox and TableView Demos/NSOutlineView/Disk Browser
Blog Entries
The items on this page are in the following plugins: MBS MacBase Plugin.
NSPasteboardItemDataProviderMBS - NSPasteboardMBS