()
| 34 | func (tb *TensorButton) WidgetValue() any { return &tb.Tensor } |
| 35 | |
| 36 | func (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]. |
| 52 | type TableButton struct { |
nothing calls this directly
no test coverage detected