MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

NSPasteboardItemMBS class

class, Clipboard, MBS CocoaBase Plugin (NSPasteBoard), class NSPasteboardItemMBS,
Plugin version: 13.1, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: NSPasteboardItem is a generic class to represent an item on a pasteboard.
Example:
dim n as new NSPasteboardItemMBS

dim type as string = NSPasteboardmbs.NSPasteboardTypeString
n.stringForType(type) = "Hello World"
MsgBox n.stringForType(type)
Notes:
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.

This class has no sub classes.

Some methods using this class:

Some events for this class:

Some examples which use this class:


The items on this page are in the following plugins: MBS CocoaBase Plugin.


NSPasteboardItemDataProviderMBS   -   NSPasteboardMBS




Links
MBS Xojo Chart Plugins