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

Method Init

texteditor/highlighting/value.go:26–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24func (hb *Button) WidgetValue() any { return &hb.HighlightingName }
25
26func (hb *Button) Init() {
27 hb.Button.Init()
28 hb.SetType(core.ButtonTonal).SetIcon(icons.Brush)
29 hb.Updater(func() {
30 hb.SetText(hb.HighlightingName)
31 })
32 core.InitValueButton(hb, false, func(d *core.Body) {
33 d.SetTitle("Select a syntax highlighting style")
34 si := 0
35 ls := core.NewList(d).SetSlice(&StyleNames).SetSelectedValue(hb.HighlightingName).BindSelect(&si)
36 ls.OnChange(func(e events.Event) {
37 hb.HighlightingName = StyleNames[si]
38 })
39 })
40}
41
42// Editor opens an editor of highlighting styles.
43func Editor(st *Styles) {

Callers

nothing calls this directly

Calls 12

SetTypeMethod · 0.95
SetTextMethod · 0.95
InitValueButtonFunction · 0.92
NewListFunction · 0.92
UpdaterMethod · 0.80
BindSelectMethod · 0.80
SetSelectedValueMethod · 0.80
InitMethod · 0.65
SetIconMethod · 0.65
SetTitleMethod · 0.65
SetSliceMethod · 0.45
OnChangeMethod · 0.45

Tested by

no test coverage detected