Hi all,
having a lot of times in this period I am here polishing and refreshing my addons code ...
A couple of questions:
1) having code like this:
Lua Code:
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
local dataobj = ldb:NewDataObject("gmVideoSwitch", {
type = "data source",
icon = "Interface\\Addons\\"..ADDON.."\\bluewin.tga",
text = "-"
})
Lua Code:
function dataobj.OnEnter(self)
-- code here
end
or
Lua Code:
dataobj.OnEnter = function(self)
-- code is here
end
The above statement are equal I suppose, which is better to be written ?
And the second question.
Being defined as:
all its functions are local too automagically or it is better to defined them local too ?
Thanks.