(p *tree.Plan, i int)
| 586 | } |
| 587 | |
| 588 | func (lb *ListBase) MakeRow(p *tree.Plan, i int) { |
| 589 | svi := lb.This.(Lister) |
| 590 | si, vi, invis := svi.SliceIndex(i) |
| 591 | itxt := strconv.Itoa(i) |
| 592 | val := lb.sliceElementValue(vi) |
| 593 | |
| 594 | if lb.ShowIndexes { |
| 595 | lb.MakeGridIndex(p, i, si, itxt, invis) |
| 596 | } |
| 597 | |
| 598 | valnm := fmt.Sprintf("value-%s-%s", itxt, reflectx.ShortTypeName(lb.elementValue.Type())) |
| 599 | tree.AddNew(p, valnm, func() Value { |
| 600 | return NewValue(val.Addr().Interface(), "") |
| 601 | }, func(w Value) { |
| 602 | wb := w.AsWidget() |
| 603 | lb.MakeValue(w, i) |
| 604 | if !lb.IsReadOnly() { |
| 605 | wb.OnChange(func(e events.Event) { |
| 606 | lb.SendChange(e) |
| 607 | }) |
| 608 | } |
| 609 | wb.Updater(func() { |
| 610 | wb := w.AsWidget() |
| 611 | _, vi, invis := svi.SliceIndex(i) |
| 612 | val := lb.sliceElementValue(vi) |
| 613 | Bind(val.Addr().Interface(), w) |
| 614 | wb.SetReadOnly(lb.IsReadOnly()) |
| 615 | wb.SetState(invis, states.Invisible) |
| 616 | if lb.This.(Lister).HasStyler() { |
| 617 | w.Style() |
| 618 | } |
| 619 | if invis { |
| 620 | wb.SetSelected(false) |
| 621 | } |
| 622 | }) |
| 623 | }) |
| 624 | |
| 625 | } |
| 626 | |
| 627 | func (lb *ListBase) MakeGridIndex(p *tree.Plan, i, si int, itxt string, invis bool) { |
| 628 | ls := lb.This.(Lister) |
nothing calls this directly
no test coverage detected