drawin: Add a property miss handler

This commit is contained in:
Emmanuel Lepage Vallee 2016-05-02 23:57:33 -04:00
parent 66ca66ca87
commit 5404b3c374
1 changed files with 9 additions and 1 deletions

View File

@ -20,7 +20,7 @@ local base = require("wibox.widget.base")
--- This provides widget box windows. Every wibox can also be used as if it were
-- a drawin. All drawin functions and properties are also available on wiboxes!
-- wibox
local wibox = { mt = {} }
local wibox = { mt = {}, object = {} }
wibox.layout = require("wibox.layout")
wibox.widget = require("wibox.widget")
wibox.drawable = require("wibox.drawable")
@ -298,6 +298,7 @@ end
local function new(args)
local ret = object()
local w = capi.drawin(args)
ret.drawin = w
ret._drawable = wibox.drawable(w.drawable, { wibox = ret },
"wibox drawable (" .. object.modulename(3) .. ")")
@ -348,6 +349,13 @@ function wibox.mt:__call(...)
return new(...)
end
-- Extend the luaobject
object.properties(capi.drawin, {
getter_class = wibox.object,
setter_class = wibox.object,
auto_emit = true,
})
return setmetatable(wibox, wibox.mt)
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80