Allocate reg table with all values in one shot

This commit is contained in:
Joerg T. (Mic92) 2011-08-18 19:43:09 +02:00
parent e2cdb97e2f
commit 7c14161608
1 changed files with 12 additions and 12 deletions

View File

@ -142,20 +142,20 @@ end
-- {{{ Global functions
-- {{{ Register a widget
function register(widget, wtype, format, timer, warg)
local reg = {}
local widget = widget
local reg = {
-- Set properties
wtype = wtype,
format = format,
timer = timer,
warg = warg,
widget = widget,
-- Set properties
reg.wtype = wtype
reg.format = format
reg.timer = timer
reg.warg = warg
reg.widget = widget
-- Update function
reg.update = function ()
update(widget, reg)
end
-- Update function
update = function ()
update(widget, reg)
end,
}
-- Default to 2s timer
if reg.timer == nil then