Update Drawer Sample #4
This commit is contained in:
@@ -8,19 +8,10 @@ function on_drawer_open()
|
||||
end
|
||||
|
||||
function on_icons_ready(icons)
|
||||
names = map(pkgs, function(it) return apps:name(it) end)
|
||||
names = map(function(it) return apps:name(it) end, pkgs)
|
||||
drawer:show_list(names, icons, nil, true)
|
||||
end
|
||||
|
||||
function on_click(idx)
|
||||
apps:launch(pkgs[idx])
|
||||
end
|
||||
|
||||
function map(tbl, f)
|
||||
local ret = {}
|
||||
for k,v in pairs(tbl) do
|
||||
ret[k] = f(v)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user