The power of Dashboard comes in the form of its widgets. Widgets are the objects that users interact with when Dashboard is invoked. They perform tasks such as providing a clock or a calculator for the user. To develop a widget you must work with the bundle structure, a property list, and some combination of HTML, CSS, and JavaScript.
In this chapter, you create a simple "Hello, World!" widget:

In doing so, you take a look at a widget's bundle structure, its Info.plist property list, a basic style sheet, and the HTML file needed to make the widget function. Finally, you tie it all together and install the widget in the right place.
All of the files needed to implement this widget are installed as part of the Dashboard sample code. You can find this and other sample widgets on your hard disk at /Developer/Examples/Dashboard/ after you install the Xcode Tools. The Xcode Tools are available for download from the Apple Developer Connection website at http://connect.apple.com/.
Note: The sample code included in this chapter is simplified and may not conform to strict HTML specifications.
Widget Bundle Structure
HTML, CSS, and JavaScript Files
Widget Property Lists
Icons and Default Images
Widget Implementation
Assembling the Widget
Last updated: 2006-01-10