Originally Posted by votan
Question:
What if like this:
Bad?
Lua Code:
local function DoSomeWhat() --Code end --This is run often function SetupTexture(texture, width, height) texture:SetHandler("OnMouseEnter", DoSomeWhat) texture:SetDimensions(width, height) end
|
i suppose
Code:
onload : CreateControl +
texture:SetHandler("OnMouseEnter", DoSomeWhat) -- we got that now i think
local function DoSomeWhat(addon.a,addon.b,addon.c...)
use addon.a
use addon.b
if addon.c then
blabla
else
blob
end
end
--This is run often
function SetupTexture(a, b, c)
texture:SetDimensions(a, c)
addon.a = a
addon.b = f(b)
addon.c = constant -- whatever
end
would that be the expected solution?
i repeat my question about "removing" a Handler (seems we got 2 different answers with baertram, maybe it would be a good thing to clear it)
is niling a handler as bad as overwrite it?