| 57 | func (tb *TableButton) WidgetValue() any { return &tb.Table } |
| 58 | |
| 59 | func (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]. |
| 79 | type SimMatButton struct { |