Teek API Documentation

Thin, typed wrapper around Tk’s clipboard command family, reached via App#clipboard.

Doesn’t touch text widgets’ own copy/cut/paste at all - ttk::entry/ text already bind <<Copy>>/<<Cut>>/<<Paste>> to the expected platform keys (Control-c/x/v, plus their Command-key equivalents on macOS) via Tk’s own built-in class bindings, with nothing for teek to wire up. This class is purely for reading/writing the clipboard directly from app code (e.g. a “Copy to Clipboard” button that isn’t itself a text widget’s own selection).

Inherits: Object

Instance Methods

clear

Clear the clipboard without setting new contents.

Returns void

get

Returns String, nil — the clipboard's current text, or nil if it's empty/has no owner (Tk raises a TclError for this rather than returning an empty string)

initialize(app)

Returns Clipboard — a new instance of Clipboard

@api private

set(text)

Replace the clipboard’s contents outright - Tk’s own clipboard clear followed by clipboard append two-step, done as one call.

Parameters
  • text String

Returns void