Steven Nagy .NET

Sunday, 27 May 2007

Beginning with Vista Sidebar Gadgets

If you if the new version of Windows (Vista) you'll be aware of the Vista sidebar and the gadgets that sit within it. There's a few to choose from.. I like the RSS reader and the weather gadgets from Microsoft. I also have a CPU monitor that monitors both the cores in my dual core CPU.

Microsoft have made what I believe to be an extremely easy to use API. All you need is some HTML skills (or you can use Dreamweaver or Expression Web) to create your look and feel, and some javascript skills to program against the API.

Yes you heard right... no managed code. The sidebar runs kind of like a mini browser. In fact Scott Barnes mentioned that it uses some of the rendering engine from IE7. The real cool thing is that if you can run it in a browser, you can run it in a gadget. This means you can use Flash or Silverlight. That's right! Flash powered sidebar gadgets.

Ok so for people like me who are hardcore developers, we LIKE managed code. Give me C# over Javascript any day! Well I did mention Silverlight right? So you right your sidebar in Silverlight 1.1 using C#... woohoo! The only downside is that if you want to use the gadget API to save data or in some way interact with the API, you need to write javascript. Not sure how to broach this just yet, but I'll let you know if I find a post about it.

So I've gotten interested in gadgets because of a competition at Microsoft. I'm writing a gadget that displays information about the surf at your local beach (as long as your local beach is in QLD Australia, because the competition must have a QLD theme!). I've done my UI design since I believe that you have to have a nice looking gadget because people will have this on their desktop permanently. In fact, all I've done is design, and some research about where to get the wave heights from. Unfortunately I'm having no luck with the latter. If anyone knows a reliable web service or web page with this information, I'd be most greatful (and I'll let you come over and play on my XBOX when I win it).

Here's some screen shots of my UI design:






I don't really want to go into too much detail but here is the basic steps to creating and running a gadget:

1) Find your gadget folder. Mine is:
C:\Users\Steven\AppData\Local\Microsoft\Windows Sidebar\Gadgets

2) Create a new folder for your gadget, example: SurfWatch.gadget
(I think the .gadget part is essential, not totally sure)

3) Create a HTML page for your gadget (any name is fine, mines: SurfWatch.html)

4) Create a gadget.xml file, which specifies which HTML file is used for your gadget

I don't really want to say HOW to do it all, because its all readily available at this URL which is pretty useful for learning the basics. Besides, my last post was quite large so lets keep this one short, eh?

If you are in QLD Australia, you should enter the competition. Good luck with gadgets!

Labels: , , , , ,

2 Comments:

  • hey Mr Hardcore :) - don't discount Javascript so readily. If you start writing Silverlight/DLR apps and immediately ignore Javscript/IronRuby etc you will being doing yourself a disservice. Spend some time seriously learning Javascript - you will see that it is *more* powerful than c# in many respects.

    By adam11235, At 29 May 2007 20:16  

  • I'm not really discounting it for Silverlight. I'm just picking a paradigm while I learn it. I'll defo check out the Javascript API at some stage. Particularly since my new job is looking at Silverlight soon... You're a wealth of knowledge as always!

    By Steven Nagy, At 30 May 2007 06:58  

Post a Comment



<< Home