On Mon, Sep 19 2011, Zsolt Udvari wrote:
> Hi all!
>
> I've a simple question: I want to change wibox widget list at runtime.
> But does not work :(
>
> Here is my code:
>
> 1. wiboxes["bottom_right"].widgets = {}
> 2. for _,x in pairs(get_launchers_table()) do
> 3. table.insert(wiboxes["bottom_right"].widgets,launchers[x])
> 4. naughty.notify({text=x .. type(launchers[x])})
> 5. end
> 6. table.insert(wiboxes["bottom_right"].widgets,
> 7. {layout=awful.widget.layout.horizontal.leftright}
> 8. )
>
> The 4th line shows that launchers[x] exists (type: widget) - so the
> get_launchers_table() function in second line works well.
> But the 'widgets' will empty! In my wibox doesn't show anything! Why?
> Maybe use I the table.insert function badly?I think it's because table.insert and wibox.widgets is totally incompatible, because table.insert does not honor metatables functions. IIRC, that's the problem and part of the Lua broken design. :| -- Julien Danjou
pgpq6CyymYzGx.pgp
Description: PGP signature
