diff --git a/eventMouseClick.go b/eventMouseClick.go index 3656e51..4ef2114 100644 --- a/eventMouseClick.go +++ b/eventMouseClick.go @@ -62,11 +62,11 @@ func doMouseClick(w int, h int) { case widget.Checkbox: if tk.Checked() { log.Log(WARN, "checkbox is being set to false") - tk.node.State.Checked = false + tk.SetChecked(false) tk.setCheckbox() } else { log.Log(WARN, "checkbox is being set to true") - tk.node.State.Checked = true + tk.SetChecked(true) tk.setCheckbox() } me.myTree.SendUserEvent(tk.node) diff --git a/node.go b/node.go index 42ed93e..26e2efe 100644 --- a/node.go +++ b/node.go @@ -57,3 +57,7 @@ func (tk *guiWidget) GridW() int { func (tk *guiWidget) GridH() int { return tk.node.State.AtH } + +func (tk *guiWidget) SetChecked(b bool) { + tk.node.State.Checked = b +}