summaryrefslogtreecommitdiff
path: root/checkbox.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-28 03:33:08 -0600
committerJeff Carr <[email protected]>2024-01-28 03:33:08 -0600
commite678a5cc626c9cfdcb2f593b49598732052495cd (patch)
tree56361aa3408154f325a4f21f5e1f21b15f361251 /checkbox.go
parent1f3d664dbdee1b567f5b40e06c63c07c4667d5f4 (diff)
fake buttons have labels
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'checkbox.go')
-rw-r--r--checkbox.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/checkbox.go b/checkbox.go
index 7fecb27..79128db 100644
--- a/checkbox.go
+++ b/checkbox.go
@@ -8,14 +8,17 @@ func (w *guiWidget) setCheckbox(b any) {
if w.node.WidgetType != widget.Checkbox {
return
}
+ if w.node.State.Label == "" {
+ w.node.State.Label = "BLANK"
+ }
if widget.GetBool(b) {
w.checked = widget.GetBool(b)
- w.label = "X " + w.label
+ w.labelN = "X " + w.node.State.Label
} else {
w.checked = widget.GetBool(b)
- w.label = " " + w.label
+ w.labelN = " " + w.node.State.Label
}
- t := len(w.label) + 1
+ t := len(w.labelN) + 1
w.gocuiSize.w1 = w.gocuiSize.w0 + t
// w.realWidth = w.gocuiSize.Width() + me.PadW