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

Method pasteMenu

core/tree.go:1335–1342  ·  view source on GitHub ↗

pasteMenu performs a paste from the clipboard using given data, by popping up a menu to determine what specifically to do.

(md mimedata.Mimes)

Source from the content-addressed store, hash-verified

1333// pasteMenu performs a paste from the clipboard using given data,
1334// by popping up a menu to determine what specifically to do.
1335func (tr *Tree) pasteMenu(md mimedata.Mimes) {
1336 tr.UnselectAll()
1337 mf := func(m *Scene) {
1338 tr.makePasteMenu(m, md, nil)
1339 }
1340 pos := tr.ContextMenuPos(nil)
1341 NewMenu(mf, tr.This.(Widget), pos).Run()
1342}
1343
1344// makePasteMenu makes the menu of options for paste events
1345// Optional function is typically the DropFinalize but could also be other actions

Callers 1

PasteMethod · 0.95

Calls 5

UnselectAllMethod · 0.95
makePasteMenuMethod · 0.95
ContextMenuPosMethod · 0.95
NewMenuFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected