cut cuts any selected text and adds it to the clipboard.
()
| 1006 | |
| 1007 | // cut cuts any selected text and adds it to the clipboard. |
| 1008 | func (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 |
no test coverage detected