WoW:Creating simple pop-up dialog boxes (source)
Revision as of 16:15, 16 September 2006
, 16 September 2006→Editable Text Fields
No edit summary |
|||
| Line 78: | Line 78: | ||
=== Editable Text Fields === | === Editable Text Fields === | ||
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: | |||
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 == | ||