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

Method Init

tensor/tensorcore/values.go:86–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84func (tb *SimMatButton) WidgetValue() any { return &tb.SimMat }
85
86func (tb *SimMatButton) Init() {
87 tb.Button.Init()
88 tb.SetType(core.ButtonTonal).SetIcon(icons.Edit)
89 tb.Updater(func() {
90 text := "None"
91 if tb.SimMat != nil && tb.SimMat.Mat != nil {
92 if nm, has := tb.SimMat.Mat.MetaData("name"); has {
93 text = nm
94 } else {
95 text = "SimMat"
96 }
97 }
98 tb.SetText(text)
99 })
100 core.InitValueButton(tb, true, func(d *core.Body) {
101 NewSimMatGrid(d).SetSimMat(tb.SimMat)
102 })
103}

Callers

nothing calls this directly

Calls 9

InitValueButtonFunction · 0.92
NewSimMatGridFunction · 0.85
UpdaterMethod · 0.80
InitMethod · 0.65
SetIconMethod · 0.65
MetaDataMethod · 0.65
SetTypeMethod · 0.45
SetTextMethod · 0.45
SetSimMatMethod · 0.45

Tested by

no test coverage detected