I made a Widget!

In the course of the day, I actually open several web pages related to the work I do. The browser, for better or for worse, has become part of my workflow.

After a while, it can get annoying to constantly have to log in to separate pages to see all of the data I need for work.

Well, why not use Dashboard? I could use some of the Widgets that are already out there, but then there would be a security issue.

So, time to break out Dashcode.

Authoring Widgets couldn't get easier

To my surprise, it was really easy creating a Widget using Dashcode. For my needs, I needed to create a custom RSS reader and a template for one was already supplied with the IDE.

The whole process involves working down a checklist of items the IDE requires for making the Widget work.

For any custom control you add to the interface, the IDE nicely displays all of the messages the control can respond to and easily places you in the JavaScript code so that you can edit your custom handler.

The only part that I had to dig around for was how to save out the Widget preferences.

After some digging around, I found the sync() function which actually makes a call to the preferenceForKey() function. This, along with the setPreferenceForKey() function was how I was able to get and set the preferences for my custom Widget.

So, I only created one text field to hold my URL, a button to set the preferences and within that same function, the call to bring the front of the Widget back around.

Not bad!

Leave a Reply

Your email address will not be published. Required fields are marked *