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

Method SetLeadingIcon

core/textfield.go:468–474  ·  view source on GitHub ↗

SetLeadingIcon sets the [TextField.LeadingIcon] to the given icon. If an on click function is specified, it also sets the [TextField.LeadingIconOnClick] to that function. If no function is specified, it does not override any already set function.

(icon icons.Icon, onClick ...func(e events.Event))

Source from the content-addressed store, hash-verified

466// to that function. If no function is specified, it does not override any already
467// set function.
468func (tf *TextField) SetLeadingIcon(icon icons.Icon, onClick ...func(e events.Event)) *TextField {
469 tf.LeadingIcon = icon
470 if len(onClick) > 0 {
471 tf.LeadingIconOnClick = onClick[0]
472 }
473 return tf
474}
475
476// SetTrailingIcon sets the [TextField.TrailingIcon] to the given icon. If an
477// on click function is specified, it also sets the [TextField.TrailingIconOnClick]

Callers 7

TestTextFieldIconsFunction · 0.80
InitMethod · 0.80
InitMethod · 0.80
InitMethod · 0.80
TestWidgetPrevFunction · 0.80
TestWidgetNextFunction · 0.80
inputsFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestTextFieldIconsFunction · 0.64
TestWidgetPrevFunction · 0.64
TestWidgetNextFunction · 0.64