summaryrefslogtreecommitdiff
path: root/checkbox.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-19 03:45:21 -0600
committerJeff Carr <[email protected]>2024-01-19 03:45:21 -0600
commitc682272f56094fc816c6b7fbee84351f5608c259 (patch)
treecf737588d966aa847a1184d98ae8a890f3bb7ac9 /checkbox.go
parentd4891c4d58380a81275d315151c2abc58ca1f291 (diff)
auto typist auto hides
Signed-off-by: Jeff Carr <[email protected]>
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