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

Method Init

core/funcbutton.go:146–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144}
145
146func (fb *FuncButton) Init() {
147 fb.Button.Init()
148 fb.WarnUnadded = true
149 fb.Styler(func(s *styles.Style) {
150 if fb.IsReadOnly() {
151 s.SetAbilities(false, abilities.Hoverable, abilities.Clickable, abilities.Activatable)
152 s.Cursor = cursors.None
153 }
154 })
155 fb.OnClick(func(e events.Event) {
156 if !fb.IsReadOnly() {
157 fb.CallFunc()
158 }
159 })
160}
161
162// SetText sets the [FuncButton.Text] and updates the tooltip to
163// correspond to the new name.

Callers

nothing calls this directly

Calls 6

CallFuncMethod · 0.95
StylerMethod · 0.80
SetAbilitiesMethod · 0.80
InitMethod · 0.65
IsReadOnlyMethod · 0.45
OnClickMethod · 0.45

Tested by

no test coverage detected