On Wed, Apr 20, 2011 at 4:38 AM, Adrian C. <[email protected]> wrote:
> On Wed, 20 Apr 2011, chris M. sprite wrote:
>
>> > but the new swapwidget can not work . display nothing ,
>
> Again, really?
>
> Let me draw it for you this time: Your code is broken.
lol, I guess we should be more specific?
-- Ram widget
memwidget = widget({ type = "textbox" })
vicious.cache(vicious.widgets.mem)
-- here you 1st register the 'memwidget'
vicious.register(memwidget, vicious.widgets.mem, "" .. colwhi .. "Ram
" .. coldef .. colbyel .. "$1% ($2 M)" .. coldef .. "", 13)
-- swap widget
swapwidget = widget({ type = "textbox" }) -- you never were
registering this widget
vicious.cache(vicious.widgets.mem) -- here you are caching again, dont do that
-- Here you are registering the SAME 'memwidget' with vicious.
-- vicious.register(memwidget, vicious.widgets.mem, "" .. colwhi ..
"swap " .. coldef .. colbyel .. "$5% ($6 M)" .. coldef .. "", 13)
-- You should be doing this:
vicious.register(swapwidget, vicious.widgets.mem, "" .. colwhi ..
"swap " .. coldef .. colbyel .. "$5% ($6 M)" .. coldef .. "", 13)
swapwidget, separator,
memwidget, separator,
--
To unsubscribe, send mail to [email protected].