diff options
Diffstat (limited to 'checkbox.go')
| -rw-r--r-- | checkbox.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/checkbox.go b/checkbox.go index 1ca0a9a..7fecb27 100644 --- a/checkbox.go +++ b/checkbox.go @@ -1,23 +1,21 @@ package main import ( - // "github.com/awesome-gocui/gocui" "go.wit.com/widget" ) -func (n *node) setCheckbox(b any) { - w := n.tk - if n.WidgetType != widget.Checkbox { +func (w *guiWidget) setCheckbox(b any) { + if w.node.WidgetType != widget.Checkbox { return } if widget.GetBool(b) { - n.value = b - n.tk.label = "X " + n.label + w.checked = widget.GetBool(b) + w.label = "X " + w.label } else { - n.value = b - n.tk.label = " " + n.label + w.checked = widget.GetBool(b) + w.label = " " + w.label } - t := len(n.tk.label) + 1 + t := len(w.label) + 1 w.gocuiSize.w1 = w.gocuiSize.w0 + t // w.realWidth = w.gocuiSize.Width() + me.PadW @@ -28,6 +26,6 @@ func (n *node) setCheckbox(b any) { // w.realHeight += me.FramePadH // } - n.deleteView() - n.showView() + w.deleteView() + w.showView() } |
