View Single Post
07-28-17, 09:45 AM   #1
Mortimerlol
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Jul 2017
Posts: 71
Editbox and Button sync...

Hello, somebody can say me the error? I need print the text typed in a editbox when press the respective button.
Lua Code:
  1. Gui.func3frame.input = CreateFrame("EditBox", "same", Gui.func3frame, 'InputBoxTemplate')
  2. Gui.func3frame.input:SetSize(200,22)
  3. Gui.func3frame.input:SetAutoFocus(false)
  4. Gui.func3frame.input:SetMaxLetters(30)
  5. Gui.func3frame.input:SetPoint("CENTER", -65, 30)
  6. Gui.func3frame.input:SetScript('OnEnterPressed', function(arg3)
  7.     local arg3 = self:GetText()
  8. end)
  9. --
  10. Gui.func3frame.add = CreateFrame("Button", "same", Gui.func3frame, "UIPanelButtonTemplate")
  11. Gui.func3frame.add:SetSize(50,22)
  12. Gui.func3frame.add:SetPoint("CENTER", 70, 30)
  13. Gui.func3frame.add:SetText("Add")
  14. Gui.func3frame.add:SetScript("OnClick", function(arg3)
  15.     print("added: " ..arg3)
  16. end)
Thanks, and sorry! Maybe I'm asking too much.
  Reply With Quote