I was able to recycle some of the Shadow4 widget code and make a new widget that shows only the current Environment Canada weather warning for my forecast area. At first I tried to integrate it with the existing weather widget, but I soon realized making a separate widget would be easier.
It works fine, but I would like to go one step further and try to change the background of the widget dynamically to reflect the warning status. If there is no warning, the text displays "No watches or warnings in effect." If there is a warning, it will display "BLIZZARD WARNING" or "TORNADO WATCH", etc. Only when a watch or warning is issued, do I want the background to change to another color, in this case: red.
I have the normal grey background and red background ready to go.
Now how do I set a variable in the LUA script, AND get the XML file to "listen" to the variable and display the correct background image? I was trying to set a variable basically saying
if warningtext = "No watches or warnings in effect." then
background = grey
else background = red
And call the background from the XML file but alas no dice.
Any tips, please and thank you!