local function radioPressed( event ) local radio = event.target if (radio.isOn) then radio:setState( {isOn=false} ) else radio:setState( {isOn=true} ) end print( tostring( radio ) )end local radioButton = widget.newSwitch( { x = 100, y = 100, style = "radio", id = "RadioButton", initialSwitchState = true, onPress = radioPressed })
The radio starts on, when I press it, it switches off, when I press it again, it stays off when it should go back on. What am I doing wrong?
Also, is There any way to change its color or do I have to use image sheets?