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

Method Init

core/values.go:80–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78func (kb *KeyedListButton) WidgetValue() any { return &kb.Map }
79
80func (kb *KeyedListButton) Init() {
81 kb.Button.Init()
82 kb.SetType(ButtonTonal).SetIcon(icons.Edit)
83 kb.Updater(func() {
84 kb.SetText(labels.FriendlyMapLabel(reflect.ValueOf(kb.Map)))
85 })
86 InitValueButton(kb, true, func(d *Body) {
87 kl := NewKeyedList(d).SetMap(kb.Map)
88 kl.SetValueTitle(kb.ValueTitle).SetReadOnly(kb.IsReadOnly())
89 d.AddAppBar(kl.MakeToolbar)
90 })
91}
92
93// TreeButton represents a [tree.Node] value with a button.
94type TreeButton struct {

Callers

nothing calls this directly

Calls 13

FriendlyMapLabelFunction · 0.92
InitValueButtonFunction · 0.85
NewKeyedListFunction · 0.85
UpdaterMethod · 0.80
SetValueTitleMethod · 0.80
AddAppBarMethod · 0.80
InitMethod · 0.65
SetIconMethod · 0.65
SetTypeMethod · 0.45
SetTextMethod · 0.45
SetMapMethod · 0.45
SetReadOnlyMethod · 0.45

Tested by

no test coverage detected