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

Method validate

core/textfield.go:565–578  ·  view source on GitHub ↗

validate runs [TextField.Validator] and takes any necessary actions as a result of that.

()

Source from the content-addressed store, hash-verified

563// validate runs [TextField.Validator] and takes any necessary actions
564// as a result of that.
565func (tf *TextField) validate() {
566 if tf.Validator == nil {
567 return
568 }
569 err := tf.Validator()
570 if err == nil {
571 tf.clearError()
572 return
573 }
574 tf.error = err
575 tf.Update()
576 // show the error tooltip immediately
577 tf.Send(events.LongHoverStart)
578}
579
580func (tf *TextField) WidgetTooltip(pos image.Point) (string, image.Point) {
581 if tf.error == nil {

Callers 1

InitMethod · 0.95

Calls 3

clearErrorMethod · 0.95
UpdateMethod · 0.65
SendMethod · 0.45

Tested by

no test coverage detected