I want to display some easy-to-copy text in a popup dialog.
So I thought
StaticPopup_Show() with an edit box as the 'insertedFrame' argument would be the straight forward way to achieve this.
But for some reason, passing the frame to StaticPopup_Show() like this does not do anything at all:
Lua Code:
local scrollFrame = CreateFrame("ScrollFrame", nil, nil, "UIPanelScrollFrameTemplate")
scrollFrame:SetSize(300, 80)
scrollFrame:SetPoint("CENTER")
local editbox = CreateFrame("EditBox", nil, scrollFrame, "InputBoxScriptTemplate")
editbox:SetMultiLine(true)
editbox:SetAutoFocus(false)
editbox:SetFontObject(ChatFontNormal)
editbox:SetWidth(300)
editbox:SetText("test\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n")
editbox:SetCursorPosition(0)
scrollFrame:SetScrollChild(editbox)
StaticPopupDialogs["MY_TEST"] = {
text = "Test",
button1 = "OK",
}
StaticPopup_Show("MY_TEST", scrollFrame)
When I look at the code of StaticPopup_Show(), I cannot see why it should not work:
https://github.com/Gethe/wow-ui-sour...opup.lua#L4583
Can anybody explain this to me? Thanks!