IupClipboard (since 3.0)

Creates an element that allows access to the clipboard. Each clipboard should be destroyed using IupDestroy, but you can use only one for entire application because it does not store any data inside. Or you can simply create and destroy everytime you need to copy or paste.

Creation

Ihandle* IupClipboard(void); [in C]
iup.clipboard{} -> (elem: ihandle) [in Lua] 
clipboard() [in LED]

Returns: the identifier of the created element, or NULL if an error occurs.

Attributes

IMAGE (write-only): name of an image to copy (set) or paste (get), to or from the clipboard. (GTK 2.6)

IMAGEAVAILABLE (read-only): informs if there is any image available at the clipboard. (GTK 2.6)

NATIVEIMAGE: native handle of an image to copy or paste, to or from the clipboard. In Win32 is a HANDLE of a DIB. In GTK is a GdkPixbuf*. In Motif is a Pixmap. The returned handle in a paste must be released after used (GlobalFree(handle), g_object_unref(pixbuf) or XFreePixmap(display, pixmap)). After copy, do NOT release the given handle. See IUP-IM Functions for utility functions on image native handles. (GTK 2.6)

TEXT: copy or paste text to or from the clipboard.

TEXTAVAILABLE (read-only): informs if there is any text available at the clipboard.

Examples

Ihandle* clipboard = IupClipboard();
IupSetAttribute(clipboard, "TEXT", IupGetAttribute(text, "VALUE"));
IupDestroy(clipboard);
Ihandle* clipboard = IupClipboard();
IupSetAttribute(text, "VALUE", IupGetAttribute(clipboard, "TEXT"));
IupDestroy(clipboard);