summaryrefslogtreecommitdiff
path: root/checkbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'checkbox.go')
-rw-r--r--checkbox.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/checkbox.go b/checkbox.go
new file mode 100644
index 0000000..221edb4
--- /dev/null
+++ b/checkbox.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+ "go.wit.com/toolkits/tree"
+
+ "go.wit.com/dev/andlabs/ui"
+ _ "go.wit.com/dev/andlabs/ui/winmanifest"
+)
+
+func newCheckbox(p *tree.Node, n *tree.Node) {
+ if notNew(n) {
+ return
+ }
+ newt := new(guiWidget)
+
+ newt.uiCheckbox = ui.NewCheckbox(n.GetLabel())
+ newt.uiControl = newt.uiCheckbox
+
+ newt.uiCheckbox.OnToggled(func(spin *ui.Checkbox) {
+ n.SetValue(newt.checked())
+ me.myTree.DoUserEvent(n)
+ })
+
+ n.TK = newt
+ place(p, n)
+}
+
+func (t *guiWidget) checked() bool {
+ return t.uiCheckbox.Checked()
+}