Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-01-24, 01:15 AM   #2
Codger
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 35
Lua code for xml (found)

I went to ChatGPT https://chat.openai.com/ and asked them to convert the xml code to lua and the code below is the result.

Lua Code:
  1. local frame = CreateFrame("Frame", "SimpleFrame", UIParent, "BasicFrameTemplateWithInset")
  2. frame:SetSize(150, 150)
  3. frame:SetPoint("CENTER")
  4.  
  5. local closeButton = CreateFrame("Button", nil, frame, "UIPanelCloseButton")
  6. closeButton:SetPoint("TOPRIGHT", -4, -4)
  7.  
  8. local insetFrame = CreateFrame("Frame", nil, frame, "InsetFrameTemplate")
  9. insetFrame:SetPoint("TOPLEFT", 10, -26)
  10. insetFrame:SetPoint("BOTTOMRIGHT", -6, 26)
  11.  
  12. local okButton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
  13. okButton:SetText("Okay")
  14. okButton:SetSize(90, 22)
  15. okButton:SetPoint("BOTTOMRIGHT", -6, 4)
  16. okButton:SetScript("OnClick", function()
  17.     frame:Hide()
  18. end)
  19.  
  20. frame:SetScript("OnLoad", function()
  21.     frame.TitleText:SetText("Simple Frame")
  22. end)

Last edited by Codger : 04-01-24 at 07:53 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » XML to Lua?

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