func (v *Validator) IsValid() bool {
	return v.isValid
}
IsValid if valid return true
package component
import (
	"fmt"
	"github.com/jroimartin/gocui"
)
type Validate struct {
	ErrMsg string
	Do     func(value string) bool
}
type Validator struct {
	*gocui.Gui
	name      string
	errMsg    string
	isValid   bool
	validates []Validate
	*Position
}
func NewValidator(gui *gocui.Gui, name string, x, y, w, h int) *Validator {
	return &Validator{
		Gui:     gui,
		name:    name,
		isValid: true,
		Position: &Position{
			X: x,
			Y: y,
			W: w,
			H: h,
		},
	}
}
func (v *Validator) AddValidate(errMsg string, validate func(value string) bool) {
	v.validates = append(v.validates, Validate{
		ErrMsg: errMsg,
		Do:     validate,
	})
	if v.X+len(errMsg) > v.W {
		v.W += len(errMsg)
	}
}
func (v *Validator) DispValidateMsg() {
	if vi, err := v.SetView(v.name, v.X, v.Y, v.W, v.H); err != nil {
		if err != gocui.ErrUnknownView {
			panic(err)
		}
		vi.Frame = false
		vi.BgColor = gocui.ColorDefault
		vi.FgColor = gocui.ColorRed
		fmt.Fprint(vi, v.errMsg)
	}
}
func (v *Validator) CloseValidateMsg() {
	v.DeleteView(v.name)
}