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

Method Init

core/values.go:57–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55func (fb *FormButton) WidgetValue() any { return &fb.Struct }
56
57func (fb *FormButton) Init() {
58 fb.Button.Init()
59 fb.SetType(ButtonTonal).SetIcon(icons.Edit)
60 fb.Updater(func() {
61 fb.SetText(labels.FriendlyStructLabel(reflect.ValueOf(fb.Struct)))
62 })
63 InitValueButton(fb, true, func(d *Body) {
64 fm := NewForm(d).SetStruct(fb.Struct)
65 fm.SetValueTitle(fb.ValueTitle).SetReadOnly(fb.IsReadOnly())
66 if tb, ok := fb.Struct.(ToolbarMaker); ok {
67 d.AddAppBar(tb.MakeToolbar)
68 }
69 })
70}
71
72// KeyedListButton represents a map value with a button that opens a [KeyedList].
73type KeyedListButton struct {

Callers

nothing calls this directly

Calls 13

FriendlyStructLabelFunction · 0.92
InitValueButtonFunction · 0.85
NewFormFunction · 0.85
UpdaterMethod · 0.80
SetValueTitleMethod · 0.80
AddAppBarMethod · 0.80
InitMethod · 0.65
SetIconMethod · 0.65
SetTypeMethod · 0.45
SetTextMethod · 0.45
SetStructMethod · 0.45
SetReadOnlyMethod · 0.45

Tested by

no test coverage detected