Clipboard#

Read and write the system clipboard. The clipboard is global to the running application, so these are module-level functions rather than per-widget methods; they operate on the current App’s clipboard.

For a task-oriented introduction, see the Using the Clipboard how-to.

bootstack.clipboard.get_clipboard()#

Return the current text contents of the system clipboard.

Returns:

The clipboard text, or an empty string when the clipboard is empty, holds non-text data, or no App is running.

Return type:

str

bootstack.clipboard.set_clipboard(text)#

Replace the system clipboard contents with text.

Parameters:

text (str) – The text to place on the clipboard.

Raises:

RuntimeError – If called when no App is running.