[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Programmer's Guide



Retrieving Data from the Clipboard

To retrieve data from the clipboard, an application takes these steps:

  1. It calls XmClipboardStartRetrieve to begin the interaction.

  2. It makes one or more calls to XmClipboardRetrieve to retrieve data from the clipboard.

  3. It terminates the interaction by calling XmClipboardEndRetrieve.

    An application begins an interaction to retrieve data from the clipboard by calling XmClipboardStartRetrieve. The application passes a display pointer, a timestamp, and the ID of a window in the application. The application must pass the same window ID to subsequent clipboard calls in this sequence that it uses in the call to XmClipboardStartRetrieve. XmClipboardStartRetrieve locks the clipboard.

    After calling XmClipboardStartRetrieve, the application makes one or more calls to XmClipboardRetrieve to retrieve data from the clipboard, converted to a given target. The application passes XmClipboardRetrieve a buffer to receive the data. If this buffer is not large enough to contain all the data for the given target, XmClipboardRetrieve returns XmClipboardTruncate. The application can make repeated calls to XmClipboardRetrieve to retrieve the remainder of the data. The function XmClipboardInquireLength returns the length of the data on the clipboard for the given target. This allows the application to allocate a buffer of the correct size.

    XmClipboardEndRetrieve unlocks the clipboard and ends the interaction.


  4. [ Previous | Next | Contents | Glossary | Home | Search ]