Ok, I’ve resolved both of the issues. For Radio buttons on/off programatically. I am not making it ON/OFF, i am again initiallizing the buttons (removed the last ones) on any event occurs on radio buttons and setting its initial state (ON/OFF by default, it’s off). It’s code is given below.
and for scaling issue, i just comment the themeTable.button array and every thing other is fine.
– three buttons
local checkboxButton1
local checkboxButton2
local checkboxButton3
– Initialize their event functions at start
local onSwitchPress1
local onSwitchPress2
local onSwitchPress3
local text_default_color = {250,250,250}
local text_over_color = {221,221,221}
– Event functions of every radio button
function onSwitchPress1(event)
local switch = event.target
if (switch.isOn == true) then
display.remove(checkboxButton2)
display.remove(checkboxButton3)
checkboxButton2 = widget.newSwitch
{
left = 200,
top = 400,
style = “radio”,
id = “Checkbox button2”,
onPress = onSwitchPress2,
}
checkboxButton3 = widget.newSwitch
{
left = 200,
top = 530,
style = “radio”,
id = “Checkbox button3”,
onPress = onSwitchPress3,
}
end
end
function onSwitchPress2(event)
local switch = event.target
if (switch.isOn == true) then
display.remove(checkboxButton1)
display.remove(checkboxButton3)
checkboxButton1 = widget.newSwitch
{
left = 200,
top = 270,
style = “radio”,
id = “Checkbox button2”,
onPress = onSwitchPress1,
}
checkboxButton3 = widget.newSwitch
{
left = 200,
top = 530,
style = “radio”,
id = “Checkbox button3”,
onPress = onSwitchPress3,
}
end
end
function onSwitchPress3(event)
local switch = event.target
if (switch.isOn == true) then
display.remove(checkboxButton2)
display.remove(checkboxButton1)
checkboxButton2 = widget.newSwitch
{
left = 200,
top = 400,
style = “radio”,
id = “Checkbox button2”,
onPress = onSwitchPress2,
}
checkboxButton1 = widget.newSwitch
{
left = 200,
top = 270,
style = “radio”,
id = “Checkbox button3”,
onPress = onSwitchPress1,
}
end
end
checkboxButton1 = widget.newSwitch
{
left = 200,
top = 270,
style = “radio”,
id = “Checkbox button1”,
onPress = onSwitchPress1,
}
checkboxButton2 = widget.newSwitch
{
left = 200,
top = 400,
style = “radio”,
id = “Checkbox button2”,
onPress = onSwitchPress2,
}
checkboxButton3 = widget.newSwitch
{
left = 200,
top = 530,
style = “radio”,
id = “Checkbox button3”,
onPress = onSwitchPress3,
}
[import]uid: 108129 topic_id: 33037 reply_id: 140194[/import]