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

Method SetIndexView

tensor/tensorcore/table.go:159–177  ·  view source on GitHub ↗

SetIndexView sets the source IndexView of a table (using a copy so original is not modified) and then configures the display

(ix *table.IndexView)

Source from the content-addressed store, hash-verified

157// SetIndexView sets the source IndexView of a table (using a copy so original is not modified)
158// and then configures the display
159func (tb *Table) SetIndexView(ix *table.IndexView) *Table {
160 if ix == nil {
161 return tb
162 }
163
164 tb.Table = ix.Clone() // always copy
165
166 tb.This.(core.Lister).UpdateSliceSize()
167 tb.StartIndex = 0
168 tb.VisibleRows = tb.MinRows
169 if !tb.IsReadOnly() {
170 tb.SelectedIndex = -1
171 }
172 tb.ResetSelectedIndexes()
173 tb.SelectMode = false
174 tb.MakeIter = 0
175 tb.Update()
176 return tb
177}
178
179func (tb *Table) UpdateSliceSize() int {
180 tb.Table.DeleteInvalid() // table could have changed

Callers

nothing calls this directly

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 5

ResetSelectedIndexesMethod · 0.80
CloneMethod · 0.65
UpdateSliceSizeMethod · 0.65
UpdateMethod · 0.65
IsReadOnlyMethod · 0.45

Tested by

no test coverage detected