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

Method cut

core/textfield.go:1008–1019  ·  view source on GitHub ↗

cut cuts any selected text and adds it to the clipboard.

()

Source from the content-addressed store, hash-verified

1006
1007// cut cuts any selected text and adds it to the clipboard.
1008func (tf *TextField) cut() { //types:add
1009 if tf.NoEcho {
1010 return
1011 }
1012 cut := tf.deleteSelection()
1013 if cut != "" {
1014 em := tf.Events()
1015 if em != nil {
1016 em.Clipboard().Write(mimedata.NewText(cut))
1017 }
1018 }
1019}
1020
1021// deleteSelection deletes any selected text, without adding to clipboard --
1022// returns text deleted

Callers 2

insertAtCursorMethod · 0.95
handleKeyEventsMethod · 0.95

Calls 5

deleteSelectionMethod · 0.95
NewTextFunction · 0.92
EventsMethod · 0.65
WriteMethod · 0.65
ClipboardMethod · 0.65

Tested by

no test coverage detected