Originally Posted by Sharparam
... having events be dynamically (un)registered based on new keys, something like this gist. Doing that to an object from CreateFrame is certainly possible, but is it wise to alter its metatable?
|
No. Altering the metatables of Blizzard UI object types is not recommended. Also, I'm not sure I see any benefit in that particular example -- dynamically adding and removing event-handling methods to your frame seems rather convoluted, and potentially very wasteful. It's much simpler to just define all the methods you'll need, and register or unregister events directly as needed. Based on this discussion, I can only imagine that whatever language(s) you normally program in are very different than Lua...