PDA

View Full Version : widget preferences




john1123
May 28, 2005, 12:06 AM
i am using a widget called Digital World Clock (i can't post the link at the moment since dashboardwidgets.com appears to be down). It's great except that whenever i logout/restart, everything reverts back to default.

The widget is quite basic so you have to write the city name and the time offset from your current time into two text-boxes on the backside of the widget ('nameField' and 'offsetField'). I'd like to create a preference file which will save the values in those two text-boxes. Any ideas?

here is what i currently have:


if(window.widget)
{
widget.setPreferenceForKey("hello","cityName");
widget.setPreferenceForKey("+1","offsetFromNow");
}

if(window.widget)
{
var cityName = widget.preferenceForKey("cityName");
nameField = cityName;
}

{
var offsetFromNow = widget.preferenceForKey("offsetFromNow");
offsetField = offsetFromNow;

}


however, this doesn't really work. any ideas?
by the way this is my first endeavor into anything relate to coding so be easy on me
:o