Thread Tools Display Modes
Prev Previous Post   Next Post Next
05/27/14, 03:59 PM   #1
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Question Adding multiple handlers

If a control has a handler already set, for example for "OnMouseEnter", you can add your own handler like this:

local oldHandler = control:GetHandler(event)
control:SetHandler(event, function(...) oldHandler(...) myhandler(...) end)

Unfortunately, this doesn't work when the oldHandler function uses private functions. As the function is now called from the addon environment, this leads to an exception for trying to call a private function.

Any ideas how to circumvent this problem?

I tried assigning the old handler to a global variable and use "CallSecureProtected("myglobalvariablename", ...), but this didn't work either, it's not called at all.
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » Adding multiple handlers


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off