I need to create 50 different CheckButtons and wanted to do so like this:
Lua Code:
local chkBxArPosX = {180, 250, 330, 410, 500};
local chkBxArPosY = {-30, -50, -70, -90, -110, -130, -150, -170, -190, -210};
for i=0,i<10 do
for k=0,k<5 do
chkBxAr[(i*5)+k] = CreateFrame("CheckButton", "LLcheckB_n", newRaidWin, "UICheckButtonTemplate")
LLcheck1aBL:SetPoint("TOPLEFT", newRaidWin, "TOPLEFT", chkBxArPosX[k], chkBxArPosX[i]);
LLcheck1aBL:SetWidth(22);
LLcheck1aBL:SetHeight(22);
LLcheck1aBL:Hide();
end
end
where chkBxAr is a global array. I seems to be giving me trouble and I wondered if this is even doable. I'm not familiar enough with methods of troubleshooting code, so it's difficult for me to diagnose why this code doesn't work, but I figured I would ask. I would rather not repeat the same createFrame() code 50 times over for all 50 of my CheckButtons that I need.