widget: add SetChecked method to CheckBox

Signed-off-by: Alexander Arin <fralx@yandex.ru>
This commit is contained in:
Alexander Arin
2019-11-04 19:07:21 +03:00
committed by Elias Naur
parent 1110ed1aed
commit 4ac3a7fd84
+4
View File
@@ -10,6 +10,10 @@ type CheckBox struct {
checked bool
}
func (c *CheckBox) SetChecked(value bool) {
c.checked = value
}
func (c *CheckBox) Checked(gtx *layout.Context) bool {
for _, e := range c.click.Events(gtx) {
switch e.Type {