Hrm. First of all, what is Addonpanel? You should anchor your fontstrings to the scrollframe child (Parentpanel in your case). Also, any reason for a 10 pixel x-offset?
I'd use it somewhat like this:
Code:
-- create the scroll frame
local scrollArea = CreateFrame("ScrollFrame", "Scroller", UIParent, "UIPanelScrollFrameTemplate")
scrollArea:SetPoint("TOPLEFT", Parentpanel, "TOPLEFT", 8, -30)
scrollArea:SetPoint("BOTTOMRIGHT", Parentpanel, "BOTTOMRIGHT", -30, 8)
-- create the scroll frame content
local Parentpanel = CreateFrame("Frame", "Parentpanel", scrollArea) -- don't know if you need to anchor it this way, but it works for me
scrollArea:SetScrollChild(Parentpanel)
Parentpanel:SetPoint("CENTER", UIParent, "CENTER", 0, 1)
Parentpanel:SetWidth(288)
Parentpanel:SetHeight(288)
for i = 1, 30 do
local name, title, notes, enabled, loadable, reason, security = GetAddOnInfo(i)
local addonText = Parentpanel:CreateFontString("Childlist"..i, 'OVERLAY')
if i == 1 then
addonText:SetPoint("TOPLEFT", Parentpanel) -- anchors the first string, parent should be the content frame
else
addonText:SetPoint("TOPLEFT", _G["Childlist"..i-1], "BOTTOMLEFT") -- anchors any following fontstrings below the previous one
end
addonText:SetFont("Fonts\\ARIALN.ttf", 12)
addonText:SetWidth(236)
addonText:SetHeight(28)
addonText:SetJustifyH("LEFT")
addonText:SetText(title)
end
No guarantees and probably not the prettiest solution ... but I hope it helps