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

Method Init

tensor/tensorcore/tensorgrid.go:189–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

187}
188
189func (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.
208func (tg *TensorGrid) SetTensor(tsr tensor.Tensor) *TensorGrid {

Callers

nothing calls this directly

Calls 12

MinSizeMethod · 0.95
OpenTensorViewMethod · 0.95
DotFunction · 0.92
NewFuncButtonFunction · 0.92
StylerMethod · 0.80
OnDoubleClickMethod · 0.80
AddContextMenuMethod · 0.80
SetFuncMethod · 0.80
InitMethod · 0.65
DefaultsMethod · 0.65
SetMethod · 0.65
SetIconMethod · 0.65

Tested by

no test coverage detected