ok - this seems to demonstrate it well
[code]
– build.settings contain –
– ===================== –
– settings = {
– orientation = {
– default = “landscape”,
– supported =
– {
– “landscape”
– },
– },
– }
– Widget Candy
_G.GUI = require(“widget_candy”)
_G.GUI.LoadTheme(“theme_1”, “themes/theme_1/”)-- LOAD THEME 1
LINE1_NAMES = {“Line1”, “Line2”, “Line3”, “Line4”, “Line5”, “Line6”, “Line7”, “Line8”, “Line9”, “Line10”, “Line11”, “Line12”, “Line13”, “Line14”, “LineA”, “LineB”, “LineC”, “LineD”, “LineE”}
localVar = {}
local secondRadioButtonName
local w, h = display.contentWidth, display.contentHeight
local function resetLineSelection()
– ISSUE HERE: Seems to change the position of the radio button
– ERROR OCCURS HERE - i.e. moves the 2nd radio button to 0,0 on the screen it seems
_G.GUI.GetHandle(secondRadioButtonName):set(“toggleState”, true)
end
– LINE 1 Radio Buttons
local i = 1
local NUM_COLUMNS = 4
for k,v in pairs(LINE1_NAMES) do
local row = math.floor((i-1)/NUM_COLUMNS)
local column = (i - 1) % NUM_COLUMNS
local nameStr = “groupName”…i
if i == 2 then secondRadioButtonName = nameStr end
local currButton = _G.GUI.NewRadiobutton(
{
name = nameStr,
x = 0,
y = 0,
width = w / NUM_COLUMNS,
scale = 1, --_G.GUIScale,
theme = “theme_1”,
caption = v,
fontSize = 20,
textAlign = “right”,
toggleState = i == 1 and true or false,
toggleGroup = (“RadioButtonsGroup”),
group = groupName,
}
)
– scene.view:insert(currButton)
local xPos = 0 + column * w/NUM_COLUMNS
local yPos = 60 + row * 30
currButton.x, currButton.y = xPos, yPos
localVar[i] = currButton
i = i + 1
end
– ERROR OCCURS HERE - i.e. moves the 2nd radio button to 0,0 on the screen it seems
– TOGGLE THIS ON/OFF TO SEE EFFECT OF IT
resetLineSelection()
[/code] [import]uid: 140210 topic_id: 28064 reply_id: 113561[/import]