()
| 187 | } |
| 188 | |
| 189 | func (tg *TensorGrid) Init() { |
| 190 | tg.WidgetBase.Init() |
| 191 | tg.Display.GridView = tg |
| 192 | tg.Display.Defaults() |
| 193 | tg.Styler(func(s *styles.Style) { |
| 194 | ms := tg.MinSize() |
| 195 | s.Min.Set(units.Dot(ms.X), units.Dot(ms.Y)) |
| 196 | s.Grow.Set(1, 1) |
| 197 | }) |
| 198 | |
| 199 | tg.OnDoubleClick(func(e events.Event) { |
| 200 | tg.OpenTensorView() |
| 201 | }) |
| 202 | tg.AddContextMenu(func(m *core.Scene) { // todo: still not getting the context menu event at all |
| 203 | core.NewFuncButton(m).SetFunc(tg.EditSettings).SetIcon(icons.Edit) |
| 204 | }) |
| 205 | } |
| 206 | |
| 207 | // SetTensor sets the tensor. Must call Update after this. |
| 208 | func (tg *TensorGrid) SetTensor(tsr tensor.Tensor) *TensorGrid { |
nothing calls this directly
no test coverage detected