WoW:Creating simple pop-up dialog boxes: Difference between revisions

m
No edit summary
Line 78: Line 78:
=== Editable Text Fields ===
=== Editable Text Fields ===


complicated, do later
To add a editbox in the popup set the ''hasEditBox'' option to 1. The EditBox get the name "$parentEditBox", relative to the Popup. To get and set the value of the EditBox use the following code:
 
pet renames, clicking on "add ignore" or "add raid member" or "create new chat window tab", etc


OnShow = function()
    getglobal(this:GetName().."EditBox"):SetText("Some data")
    -- notice: "this" is the StaticPopup, normaly its "StaticPopup1"
end,
OnAccept = function()
    getglobal(this:GetParent():GetName().."EditBox"):GetText()
    -- do whatever you want with it
    -- notice: "this" is the left button, normaly its "StaticPopup1Button1",
    --        so you need the GetParent() call.
end,
hasEditBox = 1,


== Optional Features ==
== Optional Features ==
Anonymous user