Ricky
Registered
I'm rewriting my CompactAirPort widget from scratch using my own code, but I'm having some trouble with the widget updating the percentage bar when the AirPort signal strength changes. The code for the percentage value is:
And for the percentage bar:
It's neccesary for the widget to use fill.width so that I can use themes without having all the fill widths be 120.
Both have "GetSignal();" and "GetVal();" onTimer... Don't know what the problem is.
Here's the widget if someone wants to take a look at the .kon file inside...
-EDIT- Forgot to mention, the actual percentage value shows up just fine.
Code:
function getSignal() {
theStrength = system.airport.signal;
if ( theStrength > 50 ) {
theStrength = 50;
}
theStrength = Math.round(100 * (theStrength / 50));
airportsignal.data = theStrength + "%";
}
Code:
function getVal() {
meterVal = system.airport.signal;
if ( meterVal > 50 ) {
meterVal = 50;
}
meterVal = (fill.width * (meterVal / 50));
fill.width = meterVal;
}
Both have "GetSignal();" and "GetVal();" onTimer... Don't know what the problem is.
Here's the widget if someone wants to take a look at the .kon file inside...
-EDIT- Forgot to mention, the actual percentage value shows up just fine.