Behold the turtle

jb's Blog

"behold the turtle, he only makes progress when he sticks his neck out"
Developing Gadgets for the Windows Sidebar 18 Feb 2007 15:21

Of recent times Ive put in a bit of effort working with Windows Sidebar Gadgets. You may have seen a number of these released recently at the launch events for Vista.

Gadgets are designed to be lightweight applications and run on your desktop or can be docked to the side bar which you can configure to sit where you want on your desktop. The thought being that with the trend towards widescreen laptops and LCD panels there is a bit more room on the sides to drop little information surfacing apps which can help get you the info you need.

From a development perspective, Gadgets are put togethor using HTML, CSS and Javascript. The development experience is pretty ok (go Notepad!), but can be a bit daunting at first to get into, particularly if you dont know Javascript very well.

To help aide getting started with developing Sidebar Gadgets, you might find this "Hello World" sample useful as a stub which does all the basics (dock, undock, flyout) etc, with hooks which you can fill out functionality into.

Its structured into:

  • Gadget.xml - Manifest file
  • Gadget.html - Main UI page for the Gadget
  • Flyout.html - Flyout UI
  • Settings.html - Settings UI
  • css\mygadget.css - CSS styles to be applied to the Gadget pages
  • js\gadget.js - Base class for the Gadget functionality
  • js\mygadget.js - Sub class for your Gadgets functionality

Download the Code Sample: GadgetShim.zip

To install, unzip the contents of the folder into one of the various gadget directories; (e.g: <user>\AppData\Local\Microsoft\Windows Sidebar) and rename the extracted folder to HelloWorld.gadget.

You should now see the Gadget on the available Gadgets list when adding a Gadget to the Sidebar.

You can drag it onto the Sidebar, drag it off to move into undocked mode, or double click it to enable flyout mode.

Here are some other useful links to reference when developing Gadgets for Sidebar:

  • http://microsoftgadgets.com/Sidebar/DevelopmentOverview.aspx
  • http://msdn2.microsoft.com/en-gb/library/aa965850.aspx


comments (3)

history


2006 (47)
2007 (79)
2008 (55)

blogs i read


John-Daniel Trask
Andrew Peters
Ivan Towlson
Josh Robb
Chris Auld
Ivan Porto Carrero
Darryl Burling
Nigel Parker

links


Mindscape
Intergen
Microsoft Regional Director Microsoft MVP - SQL Server

RSS Feed rss feed