Hi All,
Just a quick share on the volume widget [Farhavens volume widget:
http://awesome.naquadah.org/wiki/Farhavens_volume_widget]
All examples have something like the following code...
myvolume.widget:buttons(
{
button({ }, 4,
function () myvolume.up() end),
button({ }, 5,
function () myvolume.down() end),
button({ }, 1,
function () myvolume.toggle() end)
}
)
I noticed a warning that the function "button" was no longer supported but
all still worked and I hadn't done anything about it until now.
As seems to be the unfortunate norm with awesome & lua, the information is
there somewhere, but damn hard to find. After a lot of searching I
eventually resorted to scanning other widgets I had and once I could see
what they did, I implemented it on mine. The warning is gone and I presume
that all is now valid ;-)
The new warning free code...
myvolume.widget:buttons(
awful.util.table.join(
awful.button({ }, 4, function () myvolume.up() end),
awful.button({ }, 5, function () myvolume.down() end),
awful.button({ }, 1, function () myvolume.toggle() end)
)
)
PS: I'm guessing it would be worth adding this to the bottom of that wiki
entry or adding a new one regarding the new way of adding buttons to widgets
that refers to the deprecation of the button() function [Volunteer? Me?].
PPS: If there is a better way, I'm happy to hear of it as well ;-)
Cheers,
Dave
--
To unsubscribe, send mail to [email protected].