blob: b3b3121f3fcc71e9b9197fbc4834694c2195ddb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package toolkit
import "log"
import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"
func (t Toolkit) NewCheckbox(name string) *Toolkit {
log.Println("gui.Toolkit.NewCheckbox()", name)
var newt Toolkit
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
}
func (t Toolkit) Checked() bool {
if t.broken() {
return false
}
return t.uiCheckbox.Checked()
}
|