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

Function SettingsEditor

core/settingseditor.go:44–61  ·  view source on GitHub ↗

SettingsEditor adds to the given body an editor of user settings.

(b *Body)

Source from the content-addressed store, hash-verified

42
43// SettingsEditor adds to the given body an editor of user settings.
44func SettingsEditor(b *Body) {
45 b.AddAppBar(func(p *tree.Plan) {
46 settingsEditorToolbarBase(p)
47 for _, se := range AllSettings {
48 se.MakeToolbar(p)
49 }
50 })
51
52 tabs := NewTabs(b)
53
54 for _, se := range AllSettings {
55 fr := tabs.NewTab(se.Label())
56
57 NewForm(fr).SetStruct(se).OnChange(func(e events.Event) {
58 UpdateSettings(fr, se)
59 })
60 }
61}

Callers 1

SettingsWindowFunction · 0.85

Calls 10

NewTabMethod · 0.95
NewTabsFunction · 0.85
NewFormFunction · 0.85
UpdateSettingsFunction · 0.85
AddAppBarMethod · 0.80
MakeToolbarMethod · 0.65
LabelMethod · 0.65
OnChangeMethod · 0.45
SetStructMethod · 0.45

Tested by

no test coverage detected