Skip to content

Commit

Permalink
Merge pull request #916 from gucio321/checkbox-id-method
Browse files Browse the repository at this point in the history
CheckboxWidget: add ID method
  • Loading branch information
gucio321 authored Nov 26, 2024
2 parents 4bc05bb + adf90ef commit 127b189
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ClickableWidgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 127b189

Please sign in to comment.