I'm working on a widget and I need it too save the preferences chosen by the user regardless if the computer was restarted or the widget was closed.
I'm using this document as reference http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_ProgTopics/Articles/Preferences.html
This is something I put together quickly to test the code, but Its not saving the value of the popup when restarted. What would be wrong with it, and sorry if this is a fairly novice question.
I'm using this document as reference http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_ProgTopics/Articles/Preferences.html
This is something I put together quickly to test the code, but Its not saving the value of the popup when restarted. What would be wrong with it, and sorry if this is a fairly novice question.
Code:
function load()
{
dashcode.setupParts();
if(window.widget)
{
var popupValue = widget.preferenceForKey(popupValue);
}
}
//When the popup value has been changed, it should save the value
function myChangeHandler(event)
{
var popupValue = document.getElementById("popup");
popupValue = popupValue.value;
if(window.widget)
{
widget.setPreferenceForKey(popupValue);
}
}