diff options
| author | Jeff Carr <[email protected]> | 2024-02-09 09:30:23 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-09 09:30:23 -0600 |
| commit | e8b090efe6d29d948629941a1ffb1ba9ca23e3a0 (patch) | |
| tree | f3f08830617c2b5d9d546aceeddab318edfa5d98 /checkbox.go | |
| parent | 7b611d3dda7490493fd096af4cb28186cb714018 (diff) | |
gocui panic loads nocui
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'checkbox.go')
| -rw-r--r-- | checkbox.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/checkbox.go b/checkbox.go index e5c730a..dac5e2e 100644 --- a/checkbox.go +++ b/checkbox.go @@ -2,9 +2,31 @@ package main import ( log "go.wit.com/log" + "go.wit.com/toolkits/tree" "go.wit.com/widget" ) +func setChecked(n *tree.Node, b bool) { + if n.WidgetType != widget.Checkbox { + } + var tk *guiWidget + tk = n.TK.(*guiWidget) + + if tk.node.State.Label == "" { + tk.node.State.Label = "BLANK" + } + if tk.node.State.Checked { + log.Log(WARN, "setCheckbox() got true", tk.node.State.Checked) + tk.labelN = "X " + tk.node.State.Label + } else { + log.Log(WARN, "setCheckbox() got false", tk.node.State.Checked) + tk.labelN = " " + tk.node.State.Label + } + + tk.Hide() + tk.Show() +} + // redraw the checkbox func (w *guiWidget) setCheckbox() { if w.node.WidgetType != widget.Checkbox { |
