Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Widget Basics

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:

The 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.

Contents:

Widget Bundle Structure
HTML, CSS, and JavaScript Files
Widget Property Lists
Icons and Default Images
Widget Implementation
Assembling the Widget




< Previous PageNext Page > Hide TOC


Last updated: 2006-01-10




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice