View Single Post
04-11-09, 09:42 PM   #3
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
A slight side note which I forgot (it's soon 6AM here after all ):

The event system in oUF handles multiple event handlers on a single-event automatically. This behavior is very uncommon for add-ons to use. Mostly because you always have a split between the different systems.

Let's take the following code as an example:
Code:
frame:RegisterEvent('EVENT1', myFunc1)
frame:RegisterEvent('EVENT1', myFunc2)
This will work just fine, but the behavior you get is pretty uncommon (compared with how Dongle/Ace handles the events). When EVENT1 fires, both functions will be executed, as oUF converts EVENT1 into a metatable and "hides" the fact that there are multiple functions connected to it.

The reason it works this way is mostly because I wanted a simple and transparent way to register multiple handlers onto a single event, without removing the ability to call them all through the ordinary syntax.

This is also the reason why you should provide the handler when you unregister the event. You can get quite the unexpected behavior if you don't .
  Reply With Quote