checkbox.go
func (c *CheckBox) SetState(val int) {
	c.mtx.Lock()
	defer c.mtx.Unlock()

	if val == c.state {
		return
	}

	if val < 0 {
		val = 0
	}
	if val > 1 && !c.allow3state {
		val = 1
	}
	if val > 2 {
		val = 2
	}

	c.state = val

	if c.onChange != nil {
		go c.onChange(val)
	}
}
func (c *CheckBox) SetState(val int) {
	c.mtx.Lock()
	defer c.mtx.Unlock()

	if val == c.state {
		return
	}

	if val < 0 {
		val = 0
	}
	if val > 1 && !c.allow3state {
		val = 1
	}
	if val > 2 {
		val = 2
	}

	c.state = val

	if c.onChange != nil {
		go c.onChange(val)
	}
}
// SetState changes the current state of CheckBox
// Value must be 0 or 1 if Allow3State is off,
// and 0, 1, or 2 if Allow3State is on