I am trying to create a bunch of buttons in a FOR loop. What is the best practice to go about doing this? I need to be able to change the button text outside the loop in another function.
Code:
for p=1,4,1 do
myButton[p] = Chain( wm:CreateControl("button"..p, ss, CT_BUTTON) )
:SetDimensions(50,50)
:SetText("button"..p)
:SetAnchor(TOPLEFT, ss, TOPLEFT, 0,(p*50)-50)
:SetFont("ZoFontAlert")
.__END
end
myButton[p]:SetText("newname")