From c682272f56094fc816c6b7fbee84351f5608c259 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 19 Jan 2024 03:45:21 -0600 Subject: auto typist auto hides Signed-off-by: Jeff Carr --- checkbox.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'checkbox.go') 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 -- cgit v1.2.3