-
Posted by emeral on Sat, 24 Oct 2009 22:05:38
Hi, I've followed the example on creating group frames using secure headers twice. Nothing happens, no errors or anything. I really need some help here : )
Thanks.
-
Posted by jnwhiteh on Sun, 25 Oct 2009 12:03:43
You need to provide quite a bit more information:
- Is the addon listed in your addon selection screen.
- Is the addon enabled?
- Check the Logs\FrameXML.log and see if there is any messages there
- Test to see whether the addon is actually loaded
It's tough for me to help, when I can't troubleshoot what your problem is =).
-
Posted by emeral on Sun, 25 Oct 2009 12:59:25
Hi again :)
I took your advice and checked the FrameXML log -- and you were right. Found the error and frames finally pop up and I get this error:
Message: [string "BasicUnitFrames_HeaderUnitButton1:OnLoad"]:1: attempt to call global 'BasicUnitFrames_Button_OnLoad' (a nil value) Time: 10/25/09 13:47:10 Count: 1 Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4> [C]: in function `BasicUnitFrames_Button_OnLoad' [string "*:OnLoad"]:1: in function <[string "*:OnLoad"]:1> [C]: in function `CreateFrame' Interface\FrameXML\SecureTemplates.lua:774: in function <Interface\FrameXML\SecureTemplates.lua:729> Interface\FrameXML\SecureTemplates.lua:1024: in function <Interface\FrameXML\SecureTemplates.lua:905> Locals: self = BasicUnitFrames_HeaderUnitButton1 { 0 = <userdata> } (*temporary) = nil (*temporary) = BasicUnitFrames_HeaderUnitButton1 { 0 = <userdata> } (*temporary) = "attempt to call global 'BasicUnitFrames_Button_OnLoad' (a nil value)"
So, there must be something wrong with the .lua file? I'm positive it loads.
.lua file: http://pastebin.com/fca7c69c
.xml file: http://pastebin.com/f39cbd088
Any ideas?
-
Posted by jnwhiteh on Sun, 25 Oct 2009 23:40:14
Getting much closer now. In the TOC file, do you have the XML file listed first or the Lua file? How do you know the Lua file it loading? You can do the following in-game to test and see that the function exists:
/dump BasicUnitFramesButtonOnLoad
It should output something to your chat frame. Does it?
-
Posted by emeral on Mon, 26 Oct 2009 14:49:45
I had no idea the file order in the .toc file mattered. I put the .lua on top and long story short, it now works!
Thanks a lot for your help :)
-
Posted by jnwhiteh on Tue, 27 Oct 2009 08:36:29
In this case, the functions that are needed in the .xml need to be loaded so they can be used. The OnLoad function, for example, is called immediately when the frame is loaded by the client, so the function it uses there needs to have already been created.