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

Method contextMenuReadOnly

core/tree.go:1198–1206  ·  view source on GitHub ↗
(m *Scene)

Source from the content-addressed store, hash-verified

1196}
1197
1198func (tr *Tree) contextMenuReadOnly(m *Scene) {
1199 tri := tr.This.(Treer)
1200 NewFuncButton(m).SetFunc(tri.Copy).SetKey(keymap.Copy).SetEnabled(tr.HasSelection())
1201 NewFuncButton(m).SetFunc(tr.editNode).SetText("View").SetIcon(icons.Visibility).SetEnabled(tr.HasSelection())
1202 NewSeparator(m)
1203
1204 NewFuncButton(m).SetFunc(tr.OpenAll).SetIcon(icons.KeyboardArrowDown).SetEnabled(tr.HasSelection())
1205 NewFuncButton(m).SetFunc(tr.CloseAll).SetIcon(icons.KeyboardArrowRight).SetEnabled(tr.HasSelection())
1206}
1207
1208func (tr *Tree) contextMenu(m *Scene) {
1209 if tr.IsReadOnly() || tr.rootIsReadOnly() {

Callers 1

contextMenuMethod · 0.95

Calls 8

HasSelectionMethod · 0.95
NewFuncButtonFunction · 0.85
NewSeparatorFunction · 0.85
SetKeyMethod · 0.80
SetFuncMethod · 0.80
SetIconMethod · 0.65
SetEnabledMethod · 0.45
SetTextMethod · 0.45

Tested by

no test coverage detected