Hi all
@MunkDev; I can almost guarantee that my code is flawed and likely very inefficient; I am self-taught with no background in coding at all.
@Seerah; thanks for detailing how the table laid out, this was extremely helpful as it really showed how I was using some tables wrong.
@Fizzlemizz; thanks for the example code, this put Seerah's explanation into action and has been a massive help in the way I approach tables and frames.
Just a follow-up question;
Is this chunk;
Lua Code:
local frameA = CreateFrame("Frame", frameA, UIParent)
frameA.Button1 = CreateFrame("Button", frameAButton1, frameA)
frameA.Button1:ClearAllPoints()
frameA.Button1:SetPoint("CENTER", 0, 0)
frameA.Button1:SetSize(40, 40)
the same as;
Lua Code:
local frameA = CreateFrame("Frame", frameA, UIParent)
frameAButton1 = CreateFrame("Button", frameAButton1, frameA)
frameAButton1:ClearAllPoints()
frameAButton1:SetPoint("CENTER", 0, 0)
frameAButton1:SetSize(40, 40)
In the first chunk, I add the button and the button properties directly to the frame.
In the second I add the button to the frame and then add the properties to the button itself.
Both chunks seem to work but I do not know which one is the proper/correct way of coding this.