Thread Tools Display Modes
Prev Previous Post   Next Post Next
05/25/14, 08:42 PM   #1
hulksmash
 
hulksmash's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 30
dynamic buttons

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")
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » dynamic buttons


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off