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

Method PasteAtIndex

tensor/tensorcore/table.go:716–731  ·  view source on GitHub ↗

PasteAtIndex inserts object(s) from mime data at (before) given slice index adds to end of table

(md mimedata.Mimes, idx int)

Source from the content-addressed store, hash-verified

714// PasteAtIndex inserts object(s) from mime data at (before) given slice index
715// adds to end of table
716func (tb *Table) PasteAtIndex(md mimedata.Mimes, idx int) {
717 recs := tb.FromMimeData(md)
718 nr := len(recs) - 1
719 if nr <= 0 {
720 return
721 }
722 tb.Table.InsertRows(idx, nr)
723 for ri := 0; ri < nr; ri++ {
724 rec := recs[1+ri]
725 rw := tb.Table.Indexes[idx+ri]
726 tb.Table.Table.ReadCSVRow(rec, rw)
727 }
728 tb.SendChange()
729 tb.SelectIndexEvent(idx, events.SelectOne)
730 tb.Update()
731}

Callers

nothing calls this directly

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 6

FromMimeDataMethod · 0.95
InsertRowsMethod · 0.80
ReadCSVRowMethod · 0.80
SendChangeMethod · 0.80
SelectIndexEventMethod · 0.80
UpdateMethod · 0.65

Tested by

no test coverage detected