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

Method contextMenu

core/textfield.go:1086–1096  ·  view source on GitHub ↗
(m *Scene)

Source from the content-addressed store, hash-verified

1084}
1085
1086func (tf *TextField) contextMenu(m *Scene) {
1087 NewFuncButton(m).SetFunc(tf.copy).SetIcon(icons.Copy).SetKey(keymap.Copy).SetState(tf.NoEcho || !tf.hasSelection(), states.Disabled)
1088 if !tf.IsReadOnly() {
1089 NewFuncButton(m).SetFunc(tf.cut).SetIcon(icons.Cut).SetKey(keymap.Cut).SetState(tf.NoEcho || !tf.hasSelection(), states.Disabled)
1090 paste := NewFuncButton(m).SetFunc(tf.paste).SetIcon(icons.Paste).SetKey(keymap.Paste)
1091 cb := tf.Scene.Events.Clipboard()
1092 if cb != nil {
1093 paste.SetState(cb.IsEmpty(), states.Disabled)
1094 }
1095 }
1096}
1097
1098///////////////////////////////////////////////////////////////////////////////
1099// Undo

Callers

nothing calls this directly

Calls 9

hasSelectionMethod · 0.95
NewFuncButtonFunction · 0.85
SetKeyMethod · 0.80
SetFuncMethod · 0.80
SetIconMethod · 0.65
ClipboardMethod · 0.65
IsEmptyMethod · 0.65
SetStateMethod · 0.45
IsReadOnlyMethod · 0.45

Tested by

no test coverage detected