View Single Post
11-11-12, 04:40 PM   #15
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 223
To answer your question, that method will work and is about the same as the following. You can find more in depth detail at WoWWiki or WoWPedia on "handling events".

Lua Code:
  1. local core, events = CreateFrame('Frame', addonName .. 'CoreFrame'), {}
  2.  
  3. core:RegisterEvent('ADDON_LOADED')
  4. function events:ADDON_LOADED(aName, ...)
  5.     print(aName .. " was loaded. Event handled by " .. self:GetName())
  6.     --aName .. " was loaded.  Event handled by " .. core:GetName()
  7. end
  8.  
  9. core:SetScript("OnEvent", function(self, event, ...)
  10.     events[event](self, ...);
  11. end)
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison
  Reply With Quote