While Mac OSX users have had Widgets, we on the Windows® platform side have had to settle for Google Desktop. But with Windows Vista®, Windows users now have Gadgets of their own.
Vista Sidebar Gadgets, as they're formally known, sit on a special section of your desktop called the Sidebar and give you access to mini-apps that can take the form of self-contained games or utilities. Most Gadgets to date are stand alone, but Gadgets can also connect to libraries deep under the hood.
In its simplest form, a Windows Gadget looks like an HTML file. Crack open some of the gadgets that come with Windows Vista and you'll see three basic file types familiar to any Web developer: HTML, CSS, and JavaScript. While it's possible to make more complex Gadgets, when I began to design a Gadget RSS reader for DevX Destination.NET, I realized a basic Ajax-flavored Web app would provide all the functionality the Gadget really needed.
Actually building the thing, however, was another story. In this walkthrough, I plan to highlight basic essentials most other tutorials seem to assume you already know, as well as describe some of the little gotchas I ran into. Along the way, I'll drop in a few lessons learned to make your Gadget development a bit easier.
Sidebar Gadget: Architectural Overview
As a developer, before I can understand a new technology I need to know exactly what's going on. What do the files look like? Where do they go? What does the system expect to see and where can I start taking liberties? If you're like me, Windows Gadgets will make more sense once you understand the architecture.
If you're running Windows Vista, you've probably enabled your Sidebar and taken a look at some of the gadgets that come with the OS. To look at their source, find where the gadget folder is located on your install. It's usually something like C:\Program Files\Windows Sidebar\Gadgets. In this folder, you'll see several subfolders, each with a ".Gadget" extension. When you download a gadget, it's usually packaged as a compressed folder with a .gadget extension. Double-clicking such a file prompts Windows Vista to install the gadget to the Gadget Gallery that opens when you click the "+" in the Sidebar. However, putting an uncompressed folder in the Program Files directory and giving it a ".Gadget" extension also adds the gadget to the gallery, provided it includes certain files.
| Editor's Note: : If you've never seen Windows Vista or its Windows Sidebar, be sure to watch the video walkthrough of Justin's Sidebar Gadget here |