awful.menu: add __call on module

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-07-15 15:57:31 +02:00
parent fb68558b2f
commit 18e96e360d
2 changed files with 9 additions and 4 deletions

View File

@ -102,10 +102,10 @@ myawesomemenu = {
{ "quit", awesome.quit } { "quit", awesome.quit }
} }
mymainmenu = awful.menu.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal } { "open terminal", terminal }
} }
}) })
mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
menu = mymainmenu }) menu = mymainmenu })

View File

@ -9,6 +9,7 @@
local pairs = pairs local pairs = pairs
local table = table local table = table
local type = type local type = type
local setmetatable = setmetatable
local wibox = wibox local wibox = wibox
local image = image local image = image
local widget = widget local widget = widget
@ -369,3 +370,7 @@ function new(menu, parent, num)
return data return data
end end
setmetatable(_M, { __call = function(_, ...) return new(...) end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80