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

Method Init

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

Source from the content-addressed store, hash-verified

34func (tb *TensorButton) WidgetValue() any { return &tb.Tensor }
35
36func (tb *TensorButton) Init() {
37 tb.Button.Init()
38 tb.SetType(core.ButtonTonal).SetIcon(icons.Edit)
39 tb.Updater(func() {
40 text := "None"
41 if tb.Tensor != nil {
42 text = "Tensor"
43 }
44 tb.SetText(text)
45 })
46 core.InitValueButton(tb, true, func(d *core.Body) {
47 NewTensorGrid(d).SetTensor(tb.Tensor)
48 })
49}
50
51// TableButton presents a button that pulls up the [Table] viewer for a [table.Table].
52type TableButton struct {

Callers

nothing calls this directly

Calls 8

InitValueButtonFunction · 0.92
NewTensorGridFunction · 0.85
UpdaterMethod · 0.80
InitMethod · 0.65
SetIconMethod · 0.65
SetTypeMethod · 0.45
SetTextMethod · 0.45
SetTensorMethod · 0.45

Tested by

no test coverage detected