Programmer's Reference
Common Widgets provides operations to interact with the platform clipboard,
which holds data to be transferred between applications. An application
can copy data from Smalltalk to the clipboard, and paste data from the
clipboard into Smalltalk.
Data stored in the clipboard has an associated format name, which
applications use to identify the type of data. Common Widgets
automatically handles two predefined formats, string and pixmap, which are
mapped to the corresponding platform-specific format during clipboard
operations. Applications can also work with platform-specific formats,
or define new proprietary formats. The format names and corresponding
buffer object classes used to represent data when working with the clipboard
include the following:
- STRING
- String
- PIXMAP
- CgPixmap
- All others
- ByteArray
The class CgDisplay implements the clipboard operations.
All operations require a CgWindow parameter, which identifies the
application to the OS window system. The window can be any valid
CgWindow. The available clipboard operations include the
following:
- clipboardStartCopy:clipLabel:itemIdReturn:
- Sets up OS clipboard storage and data structures to receive data
- clipboardCopy:itemId:formatName:buffer:privateId:
- Copies data to the clipboard
- clipboardCancelCopy:itemId:
- Cancels a copy operation that has been started
- clipboardEndCopy:itemId:
- Ends a copy to the clipboard
- clipboardInquireCount:countReturn:
- Returns the number of data item formats in the clipboard
- clipboardInquireFormat:index:formatNameReturn:
- Returns the format of a data item
- clipboardInquireLength:formatName:lengthReturn:
- Returns the length of the stored data
- clipboardStartRetrieve:
- Starts a copy from the clipboard
- clipboardRetrieve:formatName:bufferReturn:privateIdReturn:
- Retrieves a data item from the clipboard
- clipboardEndRetrieve:
- Ends a copy from the clipboard
- clipboardLock:
- Locks the clipboard
- clipboardUnlock:
- Unlocks the clipboard
- clipboardRegisterFormat:formatLength:
- Registers a new format
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]