View Single Post
03-09-12, 03:43 PM   #34
kaels
A Cyclonian
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 46
Message: ...terface\AddOns\AftermathhUI_GUI\AftermathhUI_GUI.lua:282: attempt to get length of global 'boxes' (a nil value)
Time: 03/09/12 13:07:53
Count: 1
Stack: ...terface\AddOns\AftermathhUI_GUI\AftermathhUI_GUI.lua:282: in function <...terface\AddOns\AftermathhUI_GUI\AftermathhUI_GUI.lua:278>
...terface\AddOns\AftermathhUI_GUI\AftermathhUI_GUI.lua:290: in function `DisplayCheckboxes'
...terface\AddOns\AftermathhUI_GUI\AftermathhUI_GUI.lua:294: in main chunk

Locals: bin = <table> {
}
(*temporary) = 1
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to get length of global 'boxes' (a nil value)"
Sorry!

In your Checkbox function, you need to add at the end:
lua Code:
  1. return checkbox

And then this line:
lua Code:
  1. AftermathUIFrame.checkboxes = checkboxes
should have been
lua Code:
  1. AftermathUIFrame.checkboxes = boxes
You should definitely listen to Phanx over me with respect to recycling...at the very least though I think you want to keep a table to hold on to the frames you're using. You could change ReleaseCheckboxes() to simply:
lua Code:
  1. local function ReleaseCheckboxes()
  2.     local boxes = AftermathUIFrame.checkboxes
  3.    
  4.     for i = 1, #boxes do
  5.         boxes[i]:Hide()
  6.         boxes[i] = nil
  7.     end
  8. end
  Reply With Quote