copy copies any selected text to the clipboard.
()
| 1042 | |
| 1043 | // copy copies any selected text to the clipboard. |
| 1044 | func (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. |
no test coverage detected