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

Method pasteAssign

core/tree.go:1378–1392  ·  view source on GitHub ↗

pasteAssign assigns mime data (only the first one!) to this node

(md mimedata.Mimes)

Source from the content-addressed store, hash-verified

1376
1377// pasteAssign assigns mime data (only the first one!) to this node
1378func (tr *Tree) pasteAssign(md mimedata.Mimes) {
1379 if tr.SyncNode != nil {
1380 tr.pasteAssignSync(md)
1381 return
1382 }
1383 sl, _ := tr.nodesFromMimeData(md)
1384 if len(sl) == 0 {
1385 return
1386 }
1387 tr.CopyFrom(sl[0]) // nodes with data copy here
1388 tr.setScene(tr.Scene) // ensure children have scene
1389 tr.Update() // could have children
1390 tr.Open()
1391 tr.treeChanged()
1392}
1393
1394// pasteBefore inserts object(s) from mime data before this node.
1395// If another item with the same name already exists, it will

Callers 1

makePasteMenuMethod · 0.95

Calls 7

pasteAssignSyncMethod · 0.95
nodesFromMimeDataMethod · 0.95
OpenMethod · 0.95
treeChangedMethod · 0.95
CopyFromMethod · 0.65
UpdateMethod · 0.65
setSceneMethod · 0.45

Tested by

no test coverage detected