summaryrefslogtreecommitdiff
path: root/checkbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'checkbox.go')
-rw-r--r--checkbox.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/checkbox.go b/checkbox.go
index 7771c69..9760032 100644
--- a/checkbox.go
+++ b/checkbox.go
@@ -1,16 +1,23 @@
package gui
-import "go.wit.com/widget"
+import (
+ "go.wit.com/log"
+ "go.wit.com/widget"
+)
func (n *Node) Checked() bool {
return widget.GetBool(n.value)
}
-func (n *Node) NewCheckbox(name string) *Node {
- newNode := n.newNode(name, widget.Checkbox)
+func (parent *Node) NewCheckbox(name string) *Node {
+ newNode := parent.newNode(name, widget.Checkbox)
newNode.label = name
newNode.progname = name
+ newNode.Custom = func() {
+ log.Warn("checkboxy now is", newNode.value)
+ }
+
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode