Widget Candy Question

How would I check the state of a checkbox and if true play music function and if false stop music? I know how to do this with regular buttons I’m just a bit turned around with the widgets.

Pseudo Code

If _G.GUI.NewCheckbox (named CHK_Music) toggleState = true Then
run PlayAudio Function
else

run pauseAudio Function
end
[import]uid: 148860 topic_id: 26770 reply_id: 326770[/import]