the only problem i see is that your OnClick handler is wrong.
Other than that, XML errors don't generally show up in game but from the log file out of game.
So the code posted & the error message don't have anything to do with each other
And fix your <OnClick>. You can't execute files like that. If you want to load it via XML, put <Script file="BasicNotepad.lua" /> outside the <Button>.
Also, your xsi:schemaLocation attribute's value is incorrect. It should include a linebreak, a .., and backslashes in the last section. See any XML file in the Blizzard UI for an example of a correct Ui tag for WoW:
If you want to load a Lua file from within an XML file, you must do it outside of any frame declarations, immediately after the Ui opening tag, using the Script tag:
But, as others have pointed out, the error message you posted has nothing to do with the code you posted. The game only displays errors originating from within Lua files.
Finally, you don't even need to use XML. The code you posted would be easier to read if rewritten in pure Lua, and you would get the added bonus of having detailed error messages when you did something wrong.
local button = CreateFrame("Button", "NotepadButton", UIParent, "UIPanelButtonTemplate2")
button:SetSize(50, 25)
button:SetPoint("CENTER")
button:SetText("BNote")
button:SetMovable(true)
button:SetClampedToScreen(true)
button:RegisterForDrag("LeftButton")
button:SetScript("OnDragStart", button.StartMoving)
button:SetScript("OnDragStop", button.StopMovingOrSizing)
button:SetScript("OnClick", function(self, mouseButton)
-- paste your OnClick function here
end)
button:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
GameTooltip:SetText("Click to open BasicNotepad")
GameTooltip:Show()
end)
button:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)
here's the code
and the error
I assume that i'm missing something in the code, but another addon I made with a very similar code works just fine.
all help is greatly appreciated
Other than that, XML errors don't generally show up in game but from the log file out of game.
So the code posted & the error message don't have anything to do with each other
i'll have to try that, thanks!
And fix your <OnClick>. You can't execute files like that. If you want to load it via XML, put <Script file="BasicNotepad.lua" /> outside the <Button>.
E.g.:
Also, your xsi:schemaLocation attribute's value is incorrect. It should include a linebreak, a .., and backslashes in the last section. See any XML file in the Blizzard UI for an example of a correct Ui tag for WoW:
Also, this is not correct, and will not work, and will cause your entire XML file to fail:
If you want to load a Lua file from within an XML file, you must do it outside of any frame declarations, immediately after the Ui opening tag, using the Script tag:
But, as others have pointed out, the error message you posted has nothing to do with the code you posted. The game only displays errors originating from within Lua files.
Finally, you don't even need to use XML. The code you posted would be easier to read if rewritten in pure Lua, and you would get the added bonus of having detailed error messages when you did something wrong.
I can't believe we all missed that.
I can. I see XML and go "Yeah...no."