View Single Post
05-13-12, 08:00 AM   #13
lerb
A Frostmaul Preserver
 
lerb's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 264
Alright. But where should I be putting that hooksecurefunc? I've tried adding it to the SkinGrid addon but can't get it to work.

Here's how the code looks now, but it doesn't do anything since I don't have anything in the Grid_AddBorder funcion. If you could point out where to add it that would be awesome

lua Code:
  1. local function SkinGrid()
  2.     local GridFrame = Grid and Grid:GetModule("GridFrame")
  3.     if GridFrame and GridFrame.registeredFrames then
  4.         -- print("Adding borders to Grid frames")
  5.  
  6.         local function Grid_AddBorder(f)
  7.            
  8.         end
  9.  
  10.         local o = GridFrame.RegisterFrame
  11.         GridFrame.RegisterFrame = function(self, f)
  12.             o(self, f)
  13.             Grid_AddBorder(f)
  14.         end
  15.  
  16.         return true
  17.     end
  18. end
  19.  
  20. if not SkinGrid() then
  21.     local f = CreateFrame("Frame")
  22.     f:RegisterEvent("ADDON_LOADED")
  23.     f:RegisterEvent("PLAYER_LOGIN")
  24.     f:SetScript("OnEvent", function()
  25.         if SkinGrid() then
  26.             f:UnregisterAllEvents()
  27.             f:SetScript("OnEvent", nil)
  28.             SkinGrid = nil
  29.         end
  30.     end)
  31. end
  Reply With Quote