From adf90effdd64e5697a2bafd5d0c52fe3f46b1cb1 Mon Sep 17 00:00:00 2001 From: gucio321 Date: Tue, 26 Nov 2024 23:09:24 +0100 Subject: [PATCH] CheckboxWidget: add ID method --- ClickableWidgets.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ClickableWidgets.go b/ClickableWidgets.go index e2bf6923..64215600 100644 --- a/ClickableWidgets.go +++ b/ClickableWidgets.go @@ -367,6 +367,12 @@ func Checkbox(text string, selected *bool) *CheckboxWidget { } } +// ID sets widget's id (overrides text). +func (c *CheckboxWidget) ID(id ID) *CheckboxWidget { + c.text = id + return c +} + // OnChange adds callback called when checkbox's state was changed. func (c *CheckboxWidget) OnChange(onChange func()) *CheckboxWidget { c.onChange = onChange