validate runs [TextField.Validator] and takes any necessary actions as a result of that.
()
| 563 | // validate runs [TextField.Validator] and takes any necessary actions |
| 564 | // as a result of that. |
| 565 | func (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 | |
| 580 | func (tf *TextField) WidgetTooltip(pos image.Point) (string, image.Point) { |
| 581 | if tf.error == nil { |
no test coverage detected