From 24be8643eb8173d9389f68c453ce73a04d1165dd Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 27 Apr 2009 18:39:55 +0200 Subject: [PATCH] awful.widget.button: export new correctly Signed-off-by: Julien Danjou --- lib/awful/widget/button.lua.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/awful/widget/button.lua.in b/lib/awful/widget/button.lua.in index df5f9c76..62891703 100644 --- a/lib/awful/widget/button.lua.in +++ b/lib/awful/widget/button.lua.in @@ -5,6 +5,7 @@ --------------------------------------------------------------------------- local setmetatable = setmetatable +local unpack = unpack local type = type local button = require("awful.button") local capi = { image = image, @@ -18,7 +19,7 @@ module("awful.widget.button") -- @param args Standard widget table arguments, plus image for the image path or -- the image object. -- @return A textbox widget configured as a button. -function new(_, args) +function new(args) if not args or not args.image then return end local img_release if type(args.image) == "string" then @@ -38,6 +39,6 @@ function new(_, args) return w end -setmetatable(_M, { __call = new }) +setmetatable(_M, { __call = function(_, ...) return new(unpack(arg)) end }) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80