GLXCurses.Clipboards module

class GLXCurses.Clipboards.Clipboard[source]

Bases: object

text
get()[source]

Returns the clipboard object for the given selection.

Returns:The appropriate clipboard object.
Return type:GLXCurses.Clipboard
set_text(clipboard=None, text=None, length=-1)[source]

Sets the contents of the GLXCurses.Clipboard to the given UTF-8 string. GLXCurses will make a copy of the text and take responsibility for responding for requests for the text, and for converting the text into the requested format.

Parameters:
  • clipboard (GLXCurses.Clipboard or None) – a GLXCurses.Clipboard object or None for self
  • text (str or None) – a UTF-8 string.
  • length (int) – length of text , in bytes, or -1, in which case the length will be determined with len().
wait_for_text(clipboard=None)[source]

Requests the contents of the GLXCurses.Clipboard as text and converts the result to UTF-8 if necessary. This function waits for the __area_data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait.

Parameters:clipboard (GLXCurses.Clipboard) – a GLXCurses.Clipboard
Returns:a newly-allocated UTF-8 string or NULL if retrieving the selection __area_data failed. This could happen for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into text form.).
Return type:str
set_can_store(clipboard=None, targets=None, n_targets=None)[source]

Hints that the clipboard __area_data should be stored somewhere when the application exits or when store() is called.

This value is reset when the clipboard owner changes.

Parameters:
  • clipboard (GLXCurses.Clipboard or None) – a GLXCurses.Clipboard object or None for self
  • targets (TYPE Constant or None) – array containing information about which forms should be stored or None to indicate that all forms should be stored.
  • n_targets (int or None) – number of elements in targets
store(clipboard=None)[source]

Stores the current clipboard __area_data somewhere so that it will stay around after the application has quit.

Parameters:clipboard (GLXCurses.Clipboard or None) – a GLXCurses.Clipboard object or None for self