My first Vista Sidebar gadget

2006-01-28: A small but important correction on step 2 added.

For those of us who don't like to read manuals, dig architectures, etc. but rather learn by getting dirty with code, below you will find the four steps to your first (very silly) Vista Sidebar gadget:

1. Create an HTML file with Notepad by the name of MyFirstGadget.html, with this contents:

<html>

<head>
  <title>My first gadget</title>
    <style>
      body {
        width:130;
        height:50;
      }
    </style>
</head>

<body>
  <span id="gadgetContent" style='font-family: Tahoma; font-size: 10pt;'>¡Hola mundo!</span>
</body>

</html>

2. Create an XML file with by the name of gadget.xml (must be named exactly like this!) with this contents:

2006-01-28: Added a closing slash on the info tag

<?xml version="1.0" encoding="utf-8" ?>
<gadget>
  <name>My first gadget</name>
  <namespace>LogicStudio.Vista.Gadgets</namespace>
  <version>1.0</version>
  <author name="Edgar Sánchez">
    <info url="http://www.logicstudio.net">http://www.logicstudio.net" />
  </author>
  <copyright>2006</copyright>
  <description>A very silly gadget (you've got to start somewhere, don't you?)</description>
  <hosts>
    <host name="sidebar">
      <base type="HTML" apiVersion="1.0.0" src="MyFirstGadget.html" />
        <permissions>full</permissions>
        <platform minPlatformVersion="0.3" />
    </host>
  </hosts>
</gadget>

3. Zip those two files in one archive named MyFirstInstaller.gadget. Do note that the file extension must be .gadget not .zip nor .gadget.zip nor anything like that, just .gadget.

4. Double-click on MyFirstInstaller.gadget and click on the Install button on the dialog box that pops up.

 

Done! Our first (really silly) gadget appears on the Sidebar. Now, for the gadget to do anything remotely useful you have to program it, you do that with Javascript and I plan to explain this in a future entry, those impatient among you or those who know me and knows that such next entry will take 3 months can read this article, further, if you happen to be Latin American, you can check out Desafío Gadget.

3 Comments

  • after zip , it is not opening .. it is asking select a program to open...

  • you are a slow walker,but I never walk backwards.

    -----------------------------------

  • -----------------------------------------------------------
    "Great submit & Fantastic weblog! I would definitely love to begin a weblog too but I have no clue where to begin. I possess the ability to do it (not that challenging around the technical part) but I seriously feel like I am too lazy to submit regularly. That is the problem, should you start you have to go all the way. However blogs like yours inspire me to have a go at it. "

Comments have been disabled for this content.