UI module

paste_clipboard

procedureextensionexperimentalsince 0.31.0Source

Replace the selection with the clipboard's text.

Example↗
edit: Text_Edit;
defer free_text_edit(*edit);
ui := headless();
defer free_ui(*ui);
paste_clipboard(*ui, *edit);  // inserts the clipboard text at the caret

This one is only checked to compile, not run.

paste_clipboard :: (ui: *UI_State, edit: *Text_Edit)

Replace the selection with the clipboard's text.

Parameters

ui: *UI_State
the UI whose clipboard hooks and text measuring to use.
edit: *Text_Edit
the text being edited.
Example↗
edit: Text_Edit;
defer free_text_edit(*edit);
ui := headless();
defer free_ui(*ui);
paste_clipboard(*ui, *edit);  // inserts the clipboard text at the caret

This one is only checked to compile, not run.

See also