Skip to content

Instantly share code, notes, and snippets.

@mooreatv
Created August 6, 2019 22:11
Show Gist options
  • Save mooreatv/c740e234c7d5752f78341d1c6fa52132 to your computer and use it in GitHub Desktop.
Save mooreatv/c740e234c7d5752f78341d1c6fa52132 to your computer and use it in GitHub Desktop.
Minimal Scrolling Editbox (wow addon / lua)
local s = CreateFrame("ScrollFrame", nil, UIParent, "UIPanelScrollFrameTemplate") -- or your actual parent instead
s:SetSize(300,200)
s:SetPoint("CENTER")
local e = CreateFrame("EditBox", nil, s)
e:SetMultiLine(true)
e:SetFontObject(ChatFontNormal)
e:SetWidth(300)
s:SetScrollChild(e)
local text = ""
for i=1,100 do
text = text .. "line " .. tonumber(i) .. "\n"
end
e:SetText(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment