MCPcopy Create free account
hub / github.com/cogentcore/core / copy

Method copy

core/textfield.go:1044–1055  ·  view source on GitHub ↗

copy copies any selected text to the clipboard.

()

Source from the content-addressed store, hash-verified

1042
1043// copy copies any selected text to the clipboard.
1044func (tf *TextField) copy() { //types:add
1045 if tf.NoEcho {
1046 return
1047 }
1048 tf.selectUpdate()
1049 if !tf.hasSelection() {
1050 return
1051 }
1052
1053 md := mimedata.NewText(tf.Text())
1054 tf.Clipboard().Write(md)
1055}
1056
1057// paste inserts text from the clipboard at current cursor position; if
1058// cursor is within a current selection, that selection is replaced.

Callers 1

handleKeyEventsMethod · 0.95

Calls 6

selectUpdateMethod · 0.95
hasSelectionMethod · 0.95
TextMethod · 0.95
NewTextFunction · 0.92
WriteMethod · 0.65
ClipboardMethod · 0.65

Tested by

no test coverage detected