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

Method editNode

core/treesync.go:351–363  ·  view source on GitHub ↗

editNode pulls up a [Form] dialog for the node. If SyncNode is set, operates on Sync Tree.

()

Source from the content-addressed store, hash-verified

349// editNode pulls up a [Form] dialog for the node.
350// If SyncNode is set, operates on Sync Tree.
351func (tr *Tree) editNode() { //types:add
352 if tr.SyncNode != nil {
353 tynm := tr.SyncNode.AsTree().NodeType().Name
354 d := NewBody().AddTitle(tynm)
355 NewForm(d).SetStruct(tr.SyncNode).SetReadOnly(tr.IsReadOnly())
356 d.RunWindowDialog(tr)
357 } else {
358 tynm := tr.NodeType().Name
359 d := NewBody().AddTitle(tynm)
360 NewForm(d).SetStruct(tr.This).SetReadOnly(tr.IsReadOnly())
361 d.RunWindowDialog(tr)
362 }
363}
364
365// inspectNode pulls up a new Inspector window on the node.
366// If SyncNode is set, operates on Sync Tree.

Callers

nothing calls this directly

Calls 9

NewBodyFunction · 0.85
NewFormFunction · 0.85
NodeTypeMethod · 0.80
AddTitleMethod · 0.80
RunWindowDialogMethod · 0.80
AsTreeMethod · 0.65
SetReadOnlyMethod · 0.45
SetStructMethod · 0.45
IsReadOnlyMethod · 0.45

Tested by

no test coverage detected