()
| 84 | func (tb *SimMatButton) WidgetValue() any { return &tb.SimMat } |
| 85 | |
| 86 | func (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 | } |
nothing calls this directly
no test coverage detected