diff options
| author | Jeff Carr <[email protected]> | 2024-01-11 19:10:24 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-11 19:10:24 -0600 |
| commit | 3b258d0ce0e20ffedf8804409a16abbe84f1d383 (patch) | |
| tree | 0273746324f274f5c95e96a32b06911f4dd40e05 /gocui/checkbox.go | |
| parent | c4582b0b30e3020a92baf299572d8617872d45e5 (diff) | |
var value any
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gocui/checkbox.go')
| -rw-r--r-- | gocui/checkbox.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gocui/checkbox.go b/gocui/checkbox.go index 8d350ab..18dd8fa 100644 --- a/gocui/checkbox.go +++ b/gocui/checkbox.go @@ -5,19 +5,19 @@ import ( "go.wit.com/gui/widget" ) -func (n *node) setCheckbox(b bool) { +func (n *node) setCheckbox(b any) { w := n.tk if (n.WidgetType != widget.Checkbox) { return } - if (b) { - n.B = b - n.Text = "X " + n.Name + if widget.GetBool(b) { + n.value = b + n.tk.label = "X " + n.label } else { - n.B = b - n.Text = " " + n.Name + n.value = b + n.tk.label = " " + n.label } - t := len(n.Text) + 1 + t := len(n.tk.label) + 1 w.gocuiSize.w1 = w.gocuiSize.w0 + t // w.realWidth = w.gocuiSize.Width() + me.PadW |
