Originally Posted by ProfOak
-- set the trigger to catch the event and call your function
frame:SetScript("OnEvent", function(this, event, ...)
MyAddon[event](MyAddon, ...) end; );
|
While there's nothing wrong with what you did, I strongly advise that you use "self" instead of "this" when making these types of functions. This fits the standard Lua syntax, and you'll get less confusion when others are reading your code (and may save yourself some confusion as well).