Apple includes about 20 widgets with the OS X Install, but many more are available from third parties, targeted to a vast range of specific interests and tasks, and if those aren't enough, you can make your own custom-tailored widgets using the Web Clips feature in the Safari Web browser with just a few minutes work and a few mouse clicks.
For example, Environment Canada's weather forecast page for my local area is a site I visit every day - sometimes several times a day.

Usually I'm looking for is the current forecast update, and with Web Clips, I can turn just the relevant information on the page into a Dashboard widget that I can use to check the weather without using a Web browser. This function is of course not limited to weather sites. Web Clips lets you can turn virtually any section of any Web page into a widget that will update activity every time you open it.
Here's how you go about creating a Web Clip widget.
1. If Safari isn't already up and running, open it. Go to the Web page that contains the information you want to incorporate in a widget, and click the "Clip" button in the Safari toolbar, located by default to the right of the Reload button. It's the one with the little scissors icon.

2. The browser window will go dark save for a smaller selection area that remains unshaded. The idea is that you drag the parameters of the selection area using the handles provided to include just the information you want to appear in your widget, in this instance the five-day forecast section of the Environment Canada Web page. When the selection is adjusted to your satisfaction, just click the Add button or press Return or Enter on your keyboard.

3. At this point, the Dashboard will toggle open, with your new widget centered precisely on the section of the open browser window behind it from whence it derives, but you can relocate the widget to wherever you like in the Dashboard screen.

That's all you really have to do, but if you would like to dress up and tweak your new widgets bit more, click on the little "i" button that appears when your mouse over the widget's lower right-hand corner and the widget will flip over to reveal some additional options.

You can choose from a selection of six border styles that you can apply to your widget. Also, if your widget has saved a feature on a Web page that includes audio, you will probably want to click the "Only Play Audio In Dashboard)" checkbox or the sound will keep playing even with the Dashboard closed. If you want to change the selection on the underlying Web page, click Edit to return to the front side you for adjustment. When all is to your liking, click Done.

Of course, Web Clips are "widget-authoring lite," and if you're interested in creating widgets from scratch, as it were, OS 10.5 Leopard ships with a relatively user-friendly widget development environment called "Dashcode," that you can install using the Leopard installer DVD. You'll find it in the Optional Installs Folder in the XCode Tools Folder.
For information on how to use Dashcode, visit the Apple Developer Connection's Dashcode Tutorial pages here.

Prior to the introduction of Dashcode, you had to use a text editor and a graphics application to create a widget. You used the text editor to write the widget’s structure, design, and logic and to create an Info.plist file to help Mac OS X and Dashboard to display and manage the widget properly. The graphics application was used to generate images for the widget’s interface, including two Dashboard-required images: a default image and a widget icon. To create a complete widget package, you placed all the files needed by your widget in a folder and appended it with a .wdgt extension. Finally, to test the widget, you loaded it in Dashboard. If there was a problem, you’d have to undo all the packaging to access your code and fix it.
With Dashcode, the process is greatly simplified and the programming overhead associated with widget creation is greatly reduced. Dashcode’s integrated development environment allows you to lay out, code, and even test Dashboard widgets without opening any other applications. Integrated layout tools, composers, and editors simplify the process of creating all the resources a widget needs. Dashcode offers all the text-editing features of a professional integrated development environment (IDE) - including color syntax highlighting, line numbering, and Code Sense code completion - optimized for the JavaScript programming language. The editor also integrates with the debugger, so you can easily set and view breakpoints and track your widget’s execution through the source code. Dashcode also includes handy coding and debugging tools that help you manage and test any code you write for a widget, and after you’re finished designing, coding, and testing a widget, Dashcode does all the packaging necessary to share a widget, and also includes a collection of JavaScript code snippets for many common programming tasks. Simply drag the snippet from the library and drop it into your JavaScript source file. Each snippet includes instructions for changing the behavior to meet your needs. The snippets complete many common tasks you would otherwise have to hand-code, including:
RSS parsing.
Download and understand RSS feeds to provide up-to-date information to your widget.
Animate elements.
Fade, move, or resize elements in your widget.
String and data processing.
Format and localize text.
Preferences.
Manage user preferences for your widget: Perfect for the back panel.
Parts APIs.
Manipulate the include GUI parts using JavaScript.
In summary, Dashcode includes all the tools and programming infrastructure you need to successfully develop a Dashboard widget.
Dashcode is supplied with several widget templates including a countdown timer, map, RSS feed, photocast, podcast, and gauge, or if you prefer you can create a widget from scratch from a blank template. Every template includes detailed workflow steps to guide you through the process of creating your widget. with Dashcode to provide you with a prefabricated widget framework to take the ball and run with. Templates are pre-configured skeleton widgets that include code and graphics that perform common tasks. When you open Dashcode or choose File > New Project after you open it, a dialog appears that offers you a choice of templates. Click a template icon to see a short description of the template’s abilities. If the template matches the task you’re trying to perform, select its icon and click Choose. For more on the templates included with Dashcode, read “Dashcode Templates.” Dashcode can also create a new project from an existing widget.
For more information, visit:
http://www.apple.com/macosx/developertools/dashcode.html
To view a video tutorial on creating a RSS widget using Dashcode by Michael at Apple Gazette click here:
http://www.tuaw.com/2007/02/09/nice-dashcode-tutorial-video/
Charles W. Moore
Tags: Blogs ï Hands On Mac ï Hot Topics ï Reviews ï Apple Reviews ï

Other Sites