It looks like you're wanting something like the following to create a set of columns/rows:
Lua Code:
local function buttonFrameButtonLayout()
local lastRelative, lastOnTop = NewbDevBoxButtonFrameReloadButton, NewbDevBoxButtonFrameReloadButton
local lastCount = 1
for k, v in pairs(NewbDevBoxDisplayButtonTable) do
if v then
thisButton = _G["NewbDevBoxButtonFrame" .. k]
thisButton:ClearAllPoints()
if mod(lastCount, 3) == 0 then
thisButton:SetPoint("LEFT", lastOnTop, "RIGHT", 10, 0)
lastOnTop = thisButton
else
thisButton:SetPoint("TOP", lastRelative, "BOTTOM", 0, -5)
end
lastCount = lastCount + 1
lastRelative = thisButton
--[[
thisButton:SetPoint(
VariableList.currentParentAnchorPoint,
VariableList.currentAnchorButton,
VariableList.currentChildAnchorPoint,
VariableList.currentSideGap,
VariableList.currentYGap
)
if VariableList.currentButtonCount == 3 then
VariableList.currentParentAnchorPoint = "LEFT"
VariableList.currentAnchorButton = VariableList.topAnchorButton
VariableList.currentChildAnchorPoint = "RIGHT"
VariableList.currentSideGap = NumberList.actionButtonSideGap
VariableList.currentYGap = 0
VariableList.currentButtonCount = 1
elseif VariableList.currentButtonCount == 1 then
VariableList.currentParentAnchorPoint = "BOTTOM"
VariableList.currentAnchorButton = thisButton
VariableList.currentChildAnchorPoint = "TOP"
VariableList.currentSideGap = 0
VariableList.currentYGap = NumberList.actionButtonYGap
VariableList.currentButtonCount = VariableList.currentButtonCount + 1
VariableList.topAnchorButton = thisButton
else
VariableList.currentParentAnchorPoint = "BOTTOM"
VariableList.currentAnchorButton = thisButton
VariableList.currentChildAnchorPoint = "TOP"
VariableList.currentSideGap = 0
VariableList.currentYGap = NumberList.actionButtonYGap
VariableList.currentButtonCount = VariableList.currentButtonCount + 1
end
]]--
end
end
end
This creates a column of 3 starting with the Reload button and then starts the next column to the right of the last button designated the "top button" of the last column.
Because the table you're cycling through (NewbDevBoxDisplayButtonTable) has string keys, they aren't sorted so you can't guarantee the order the buttons will be in.