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

Method SetText

core/funcbutton.go:164–172  ·  view source on GitHub ↗

SetText sets the [FuncButton.Text] and updates the tooltip to correspond to the new name.

(v string)

Source from the content-addressed store, hash-verified

162// SetText sets the [FuncButton.Text] and updates the tooltip to
163// correspond to the new name.
164func (fb *FuncButton) SetText(v string) *FuncButton {
165 ptext := fb.Text
166 fb.Text = v
167 if fb.typesFunc != nil && fb.Text != ptext && ptext != "" {
168 fb.typesFunc.Doc = types.FormatDoc(fb.typesFunc.Doc, ptext, fb.Text)
169 fb.SetTooltip(fb.typesFunc.Doc)
170 }
171 return fb
172}
173
174// SetFunc sets the function associated with the FuncButton to the
175// given function or method value. For documentation information for

Callers 4

SetFuncMethod · 0.95
setFuncImplMethod · 0.95
confirmDialogMethod · 0.45
CallFuncMethod · 0.45

Calls 2

FormatDocFunction · 0.92
SetTooltipMethod · 0.80

Tested by

no test coverage detected