summaryrefslogtreecommitdiff
path: root/checkbox.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-19 02:56:10 -0600
committerJeff Carr <[email protected]>2024-01-19 02:56:10 -0600
commitd4891c4d58380a81275d315151c2abc58ca1f291 (patch)
treeac274458682a23dda64d2fd2e12cca00d49e2222 /checkbox.go
parentb15369d85df247a460f0c0c18ac9578c79ca51a3 (diff)
cleanup andlabs
Signed-off-by: Jeff Carr <[email protected]>
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