()
| 69 | var _ core.Lister = (*Table)(nil) |
| 70 | |
| 71 | func (tb *Table) Init() { |
| 72 | tb.ListBase.Init() |
| 73 | tb.SortIndex = -1 |
| 74 | tb.TensorDisplay.Defaults() |
| 75 | tb.ColumnTensorDisplay = map[int]*TensorDisplay{} |
| 76 | tb.ColumnTensorBlank = map[int]*tensor.Float64{} |
| 77 | |
| 78 | tb.Makers.Normal[0] = func(p *tree.Plan) { // TODO: reduce redundancy with ListBase Maker |
| 79 | svi := tb.This.(core.Lister) |
| 80 | svi.UpdateSliceSize() |
| 81 | |
| 82 | scrollTo := -1 |
| 83 | if tb.InitSelectedIndex >= 0 { |
| 84 | tb.SelectedIndex = tb.InitSelectedIndex |
| 85 | tb.InitSelectedIndex = -1 |
| 86 | scrollTo = tb.SelectedIndex |
| 87 | } |
| 88 | if scrollTo >= 0 { |
| 89 | tb.ScrollToIndex(scrollTo) |
| 90 | } |
| 91 | |
| 92 | tb.UpdateStartIndex() |
| 93 | tb.UpdateMaxWidths() |
| 94 | |
| 95 | tb.Updater(func() { |
| 96 | tb.UpdateStartIndex() |
| 97 | tb.UpdateMaxWidths() |
| 98 | }) |
| 99 | |
| 100 | tb.MakeHeader(p) |
| 101 | tb.MakeGrid(p, func(p *tree.Plan) { |
| 102 | for i := 0; i < tb.VisibleRows; i++ { |
| 103 | svi.MakeRow(p, i) |
| 104 | } |
| 105 | }) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func (tb *Table) SliceIndex(i int) (si, vi int, invis bool) { |
| 110 | si = tb.StartIndex + i |
nothing calls this directly
no test coverage detected