(idx int)
| 541 | } |
| 542 | |
| 543 | func (tb *Table) editIndex(idx int) { |
| 544 | if idx < 0 || idx >= tb.sliceUnderlying.Len() { |
| 545 | return |
| 546 | } |
| 547 | val := reflectx.UnderlyingPointer(tb.sliceUnderlying.Index(idx)) |
| 548 | stru := val.Interface() |
| 549 | tynm := reflectx.NonPointerType(val.Type()).Name() |
| 550 | lbl := labels.ToLabel(stru) |
| 551 | if lbl != "" { |
| 552 | tynm += ": " + lbl |
| 553 | } |
| 554 | d := NewBody().AddTitle(tynm) |
| 555 | NewForm(d).SetStruct(stru).SetReadOnly(tb.IsReadOnly()) |
| 556 | d.AddBottomBar(func(parent Widget) { |
| 557 | d.AddCancel(parent) |
| 558 | d.AddOK(parent) |
| 559 | }) |
| 560 | d.RunFullDialog(tb) |
| 561 | } |
| 562 | |
| 563 | func (tb *Table) contextMenu(m *Scene) { |
| 564 | e := NewButton(m) |
no test coverage detected