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

Method editIndex

core/table.go:543–561  ·  view source on GitHub ↗
(idx int)

Source from the content-addressed store, hash-verified

541}
542
543func (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
563func (tb *Table) contextMenu(m *Scene) {
564 e := NewButton(m)

Callers 1

contextMenuMethod · 0.95

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 15

UnderlyingPointerFunction · 0.92
NonPointerTypeFunction · 0.92
ToLabelFunction · 0.92
NewBodyFunction · 0.85
NewFormFunction · 0.85
AddTitleMethod · 0.80
AddBottomBarMethod · 0.80
AddCancelMethod · 0.80
AddOKMethod · 0.80
RunFullDialogMethod · 0.80
LenMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected