diff options
Diffstat (limited to 'checkbox.go')
| -rw-r--r-- | checkbox.go | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/checkbox.go b/checkbox.go index 79128db..b352758 100644 --- a/checkbox.go +++ b/checkbox.go @@ -1,33 +1,30 @@ package main import ( + log "go.wit.com/log" "go.wit.com/widget" ) -func (w *guiWidget) setCheckbox(b any) { +// redraw the checkbox +func (w *guiWidget) setCheckbox() { if w.node.WidgetType != widget.Checkbox { + log.Log(WARN, "setCheckbox() being run on widget:", w.node.WidgetType) return } if w.node.State.Label == "" { w.node.State.Label = "BLANK" } - if widget.GetBool(b) { - w.checked = widget.GetBool(b) + if w.node.State.Checked { + log.Log(WARN, "setCheckbox() got true", w.node.State.Checked) w.labelN = "X " + w.node.State.Label + // w.changed = true } else { - w.checked = widget.GetBool(b) + log.Log(WARN, "setCheckbox() got false", w.node.State.Checked) w.labelN = " " + w.node.State.Label + // w.changed = true } - t := len(w.labelN) + 1 - w.gocuiSize.w1 = w.gocuiSize.w0 + t - - // w.realWidth = w.gocuiSize.Width() + me.PadW - // w.realHeight = w.gocuiSize.Height() + me.PadH - - // if w.frame { - // w.realWidth += me.FramePadW - // w.realHeight += me.FramePadH - // } + // t := len(w.labelN) + 3 + // w.gocuiSize.w1 = w.gocuiSize.w0 + t w.deleteView() w.showView() |
