2022-11-14 14:30:28 -06:00
|
|
|
package main
|
2022-10-21 11:40:08 -05:00
|
|
|
|
|
|
|
import "log"
|
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
2022-11-14 14:30:28 -06:00
|
|
|
func (t andlabsT) NewCheckbox(name string) *andlabsT {
|
2022-10-21 11:40:08 -05:00
|
|
|
log.Println("gui.Toolkit.NewCheckbox()", name)
|
2022-11-14 14:30:28 -06:00
|
|
|
var newt andlabsT
|
2022-10-21 11:40:08 -05:00
|
|
|
|
|
|
|
if t.broken() {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
c := ui.NewCheckbox(name)
|
|
|
|
newt.uiCheckbox = c
|
|
|
|
newt.uiBox = t.uiBox
|
|
|
|
t.uiBox.Append(c, stretchy)
|
|
|
|
|
|
|
|
c.OnToggled(func(spin *ui.Checkbox) {
|
|
|
|
newt.commonChange("Checkbox")
|
|
|
|
})
|
|
|
|
|
|
|
|
return &newt
|
|
|
|
}
|
|
|
|
|
2022-11-14 14:30:28 -06:00
|
|
|
func (t andlabsT) Checked() bool {
|
2022-10-21 11:40:08 -05:00
|
|
|
if t.broken() {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return t.uiCheckbox.Checked()
|
|
|
|
}
|