Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

john1123

macrumors regular
Original poster
Jan 26, 2005
246
0
Down Under
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:

Code:
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
:eek:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.