Originally Posted by ZOS_ChipHilseberg
Defining a handler in XML would set it on the control at the control's creation, which in the case of a non-virtual control would be during the load screen, which would hide any cost. This is pretty much the same as doing it in Lua during the add-on loading process. The main thing to avoid would be making a new closure and calling SetHandler with it frequently. Unless you're closing over local variables with the closure you should be able to only call SetHandler once on a control (for each handler type). If you are closing over local variables then you may want to consider not doing that, and storing the values on the control instead.
|
whaow... how to scare the noobs.
sry but i still need a translation.
are you saying "stop using anonymous functions for your handlers" or there is more to it?