[GH-ISSUE #825] Checkbox::SetChecked does not trigger Checkbox.changed(checked bool) handler #600

Closed
opened 2026-03-04 01:06:21 +03:00 by kerem · 0 comments
Owner

Originally created by @dmitrius on GitHub (Mar 15, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/825

Hi all,

Setting a checkbox state does not trigger the attached handler.
The proposed change is to modify such a behavior with calling the callback

// SetChecked sets the state of the checkbox.
func (c *Checkbox) SetChecked(checked bool) *Checkbox {
	c.checked = checked
	if c.changed != nil {
		c.changed(checked)
	}
	return c
}

Regards,
Dmitri

Originally created by @dmitrius on GitHub (Mar 15, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/825 Hi all, Setting a checkbox state does not trigger the attached handler. The proposed change is to modify such a behavior with calling the callback ``` // SetChecked sets the state of the checkbox. func (c *Checkbox) SetChecked(checked bool) *Checkbox { c.checked = checked if c.changed != nil { c.changed(checked) } return c } ``` Regards, Dmitri
kerem closed this issue 2026-03-04 01:06:21 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#600
No description provided.