summaryrefslogtreecommitdiff
path: root/checkbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'checkbox.go')
-rw-r--r--checkbox.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/checkbox.go b/checkbox.go
index 9760032..f863f8e 100644
--- a/checkbox.go
+++ b/checkbox.go
@@ -6,7 +6,14 @@ import (
)
func (n *Node) Checked() bool {
- return widget.GetBool(n.value)
+ return n.checked
+}
+
+func (n *Node) SetChecked(b bool) *Node {
+ // inform the toolkits
+ n.checked = b
+ sendAction(n, widget.Checked)
+ return n
}
func (parent *Node) NewCheckbox(name string) *Node {
@@ -15,7 +22,7 @@ func (parent *Node) NewCheckbox(name string) *Node {
newNode.progname = name
newNode.Custom = func() {
- log.Warn("checkboxy now is", newNode.value)
+ log.Warn("checkboxy now is", newNode.checked)
}
// inform the toolkits