Quantcast
insertedFrame for StaticPopup_Show() not working - WoWInterface
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-06-21, 04:47 PM   #1
LudiusMaximus
A Frostmaul Preserver
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 283
insertedFrame for StaticPopup_Show() not working

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:
  1. local scrollFrame = CreateFrame("ScrollFrame", nil, nil, "UIPanelScrollFrameTemplate")
  2. scrollFrame:SetSize(300, 80)
  3. scrollFrame:SetPoint("CENTER")
  4.  
  5. local editbox = CreateFrame("EditBox", nil, scrollFrame, "InputBoxScriptTemplate")
  6. editbox:SetMultiLine(true)
  7. editbox:SetAutoFocus(false)
  8. editbox:SetFontObject(ChatFontNormal)
  9. editbox:SetWidth(300)
  10. editbox:SetText("test\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n")
  11. editbox:SetCursorPosition(0)
  12. scrollFrame:SetScrollChild(editbox)
  13.  
  14. StaticPopupDialogs["MY_TEST"] = {
  15.     text = "Test",
  16.     button1 = "OK",
  17. }
  18.  
  19. 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!
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » insertedFrame for StaticPopup_Show() not working

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off