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

Method MakeToolbar

tensor/tensorcore/table.go:630–658  ·  view source on GitHub ↗

Copy / Cut / Paste

(p *tree.Plan)

Source from the content-addressed store, hash-verified

628// Copy / Cut / Paste
629
630func (tb *Table) MakeToolbar(p *tree.Plan) {
631 if tb.Table == nil || tb.Table.Table == nil {
632 return
633 }
634 tree.Add(p, func(w *core.FuncButton) {
635 w.SetFunc(tb.Table.AddRows).SetIcon(icons.Add)
636 w.SetAfterFunc(func() { tb.Update() })
637 })
638 tree.Add(p, func(w *core.FuncButton) {
639 w.SetFunc(tb.Table.SortColumnName).SetText("Sort").SetIcon(icons.Sort)
640 w.SetAfterFunc(func() { tb.Update() })
641 })
642 tree.Add(p, func(w *core.FuncButton) {
643 w.SetFunc(tb.Table.FilterColumnName).SetText("Filter").SetIcon(icons.FilterAlt)
644 w.SetAfterFunc(func() { tb.Update() })
645 })
646 tree.Add(p, func(w *core.FuncButton) {
647 w.SetFunc(tb.Table.Sequential).SetText("Unfilter").SetIcon(icons.FilterAltOff)
648 w.SetAfterFunc(func() { tb.Update() })
649 })
650 tree.Add(p, func(w *core.FuncButton) {
651 w.SetFunc(tb.Table.OpenCSV).SetIcon(icons.Open)
652 w.SetAfterFunc(func() { tb.Update() })
653 })
654 tree.Add(p, func(w *core.FuncButton) {
655 w.SetFunc(tb.Table.SaveCSV).SetIcon(icons.Save)
656 w.SetAfterFunc(func() { tb.Update() })
657 })
658}
659
660func (tb *Table) MimeDataType() string {
661 return fileinfo.DataCsv

Callers

nothing calls this directly

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 6

AddFunction · 0.92
SetFuncMethod · 0.80
SetAfterFuncMethod · 0.80
SetIconMethod · 0.65
UpdateMethod · 0.65
SetTextMethod · 0.45

Tested by

no test coverage detected