diff --git a/docs/03-declarative-layout.md b/docs/03-declarative-layout.md index 0c608401d..a25a34e12 100644 --- a/docs/03-declarative-layout.md +++ b/docs/03-declarative-layout.md @@ -227,11 +227,15 @@ caught by a Lua `metatable` (operator overload). Code: - -- "Monkeypatch" a new function to wibox.widget.textbox to add vicious + -- "Monkeypatch" a new function to 3 widget classes to add vicious -- extension support - function wibox.widget.textbox:vicious(args) - local f = unpack or table.unpack -- Lua 5.1 compat - vicious.register(w, f(args)) + for _, wdg in ipairs { + wibox.widget.textbox , wibox.widget.progressbar, wibox.widget.graph + } do + function wdg:vicious(args) + local f = unpack or table.unpack -- Lua 5.1 compat + vicious.register(self, f(args)) + end end s.mywibox : setup {