check_widget(): Also check .is_widget entry
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
b1e7d3c22c
commit
1dd63b04de
|
@ -559,7 +559,8 @@ end
|
|||
--- Do some sanity checking on widget. This function raises a lua error if
|
||||
-- widget is not a valid widget.
|
||||
function base.check_widget(widget)
|
||||
assert(type(widget) == "table")
|
||||
assert(type(widget) == "table", "Type should be table, but is " .. tostring(type(widget)))
|
||||
assert(widget.is_widget, "Argument is not a widget!")
|
||||
for _, func in pairs({ "add_signal", "connect_signal", "disconnect_signal" }) do
|
||||
assert(type(widget[func]) == "function", func .. " is not a function")
|
||||
end
|
||||
|
|
|
@ -84,6 +84,7 @@ return {
|
|||
local w = object()
|
||||
w:add_signal("widget::redraw_needed")
|
||||
w:add_signal("widget::layout_changed")
|
||||
w.is_widget = true
|
||||
w.visible = true
|
||||
w.opacity = 1
|
||||
if width or height then
|
||||
|
|
Loading…
Reference in New Issue