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

Method Init

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

Source from the content-addressed store, hash-verified

57func (tb *TableButton) WidgetValue() any { return &tb.Table }
58
59func (tb *TableButton) Init() {
60 tb.Button.Init()
61 tb.SetType(core.ButtonTonal).SetIcon(icons.Edit)
62 tb.Updater(func() {
63 text := "None"
64 if tb.Table != nil {
65 if nm, has := tb.Table.MetaData["name"]; has {
66 text = nm
67 } else {
68 text = "Table"
69 }
70 }
71 tb.SetText(text)
72 })
73 core.InitValueButton(tb, true, func(d *core.Body) {
74 NewTable(d).SetTable(tb.Table)
75 })
76}
77
78// SimMatValue presents a button that pulls up the [SimMatGrid] viewer for a [table.Table].
79type SimMatButton struct {

Callers

nothing calls this directly

Calls 8

InitValueButtonFunction · 0.92
UpdaterMethod · 0.80
NewTableFunction · 0.70
InitMethod · 0.65
SetIconMethod · 0.65
SetTypeMethod · 0.45
SetTextMethod · 0.45
SetTableMethod · 0.45

Tested by

no test coverage detected