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

Method pasteChildren

core/tree.go:1469–1486  ·  view source on GitHub ↗

pasteChildren inserts object(s) from mime data at end of children of this node

(md mimedata.Mimes, mod events.DropMods)

Source from the content-addressed store, hash-verified

1467// pasteChildren inserts object(s) from mime data
1468// at end of children of this node
1469func (tr *Tree) pasteChildren(md mimedata.Mimes, mod events.DropMods) {
1470 if tr.SyncNode != nil {
1471 tr.pasteChildrenSync(md, mod)
1472 return
1473 }
1474 sl, _ := tr.nodesFromMimeData(md)
1475
1476 for _, ns := range sl {
1477 tr.AddChild(ns)
1478 nwb := AsWidget(ns)
1479 ntv := AsTree(ns)
1480 ntv.root = tr.root
1481 nwb.setScene(tr.Scene)
1482 }
1483 tr.Update()
1484 tr.Open()
1485 tr.treeChanged()
1486}
1487
1488//////////////////////////////////////////////////////////////////////////////
1489// Drag-n-Drop

Callers 1

makePasteMenuMethod · 0.95

Calls 9

pasteChildrenSyncMethod · 0.95
nodesFromMimeDataMethod · 0.95
OpenMethod · 0.95
treeChangedMethod · 0.95
AsWidgetFunction · 0.85
AsTreeFunction · 0.85
UpdateMethod · 0.65
AddChildMethod · 0.45
setSceneMethod · 0.45

Tested by

no test coverage detected