diff options
| author | Jeff Carr <[email protected]> | 2024-02-01 11:59:21 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-01 11:59:21 -0600 |
| commit | 732f3c60e9cc8405e73e9f70076e52043ce4fec8 (patch) | |
| tree | 1993a15256203ff9119347f540c4badf19c357b2 /checkbox.go | |
| parent | 6fb1a5802ab574ad62261def50cae9cf677725ab (diff) | |
checkbox worksv0.19.0
Signed-off-by: Jeff Carr <[email protected]>
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() |
