Originally Posted by myrroddin
If that is what you see for unknown events, then AceEvent is registering by table, a table that has a list of events assigned to the frame. It is the second method I suggested, not the first.
|
That's what I supposed, too. But the implementation of AceEvent-3.0.lua is really beyond me...
I cannot spot any point where it would seem to maintain such a table of registered events.
What really puzzles me is why there is the unregister error when I call RegisterEvent() with callback:
Lua Code:
local myAddon = LibStub("AceAddon-3.0"):NewAddon(..., "AceEvent-3.0")
pcall(function() myAddon:RegisterEvent("NONSENSE_EVENT", function() end) end)
myAddon:UnregisterAllEvents()
-- Error: Attempt to unregister unknown event "NONSENSE_EVENT"
But no error message when I do it without callback:
Lua Code:
local myAddon = LibStub("AceAddon-3.0"):NewAddon(..., "AceEvent-3.0")
pcall(function() myAddon:RegisterEvent("NONSENSE_EVENT") end)
myAddon:UnregisterAllEvents()
-- No error.
Thanks! Your help is really appreciated.
Originally Posted by myrroddin
Please provide a working example.
|
An example is just that a user mistypes an event they want to register. The GUI looks like this: