Web Gadget SDK Web Gadget SDK
[Back to Web Gadget SDK Index]
Windows Live Gadget Developer FAQ
General Questions
  1. I have heard of Live.com, Sidebar and Sideshow Gadgets. What's the difference between them?
  2. What's the difference between live.com and start.com?
  3. What do I need to create Gadgets?
  4. What is an inline Gadget?
  5. Will my Windows Live Gadget work on the Sidebar?
  6. How do I work with themes?
  7. How do I add icons to the title bar of my gadget?
Coding Questions: How Do I...
  1. How do I get started with writing Gadgets?
  2. What APIs are available?
  3. How do I test my Gadget?
  4. How do I consume a web service in my Gadget?
  5. How do I store user preferences in my Gadget?
  6. How do I tell what the current locale is in my Gadget?
  7. How do I talk to other Gadgets on the same page?
  8. How do I get the width of <div> that my Gadget lives in?
  9. How do I enable my Gadget to access services that require Passport authentication?
  10. How do I localize my Gadget?
  11. How do I properly scope the CSS for my Gadget?
  12. How do I load my gadget from localhost for IE7?
Answers to Frequently Asked Questions
General Questions
1. I have heard of Live, Sidebar and Sideshow Gadgets. What's the difference between them? [Up]
A Gadget in general refer to a high-level component that provides some complete functionality - both visual functionality and application logic. Currently, you can build three types of Gadgets:
  • Windows Live Gadgets that run on Live.com
  • Sidebar Gadgets that run on Windows Vista Sidebar
  • Sideshow Gadget that run on the auxiliary display on some Windows Vista notebook computers

These are currently 3 separate types of Gadgets and they are not interoperable. We are currently working on a more unified story. Stay tuned.

2. What's the difference between live.com and start.com? [Up]
We started out as an incubation project at start.com, and eventually evolved into the face of Windows Live and became live.com. Live.com is what we consider to be our customer-facing, production environment, and start.com is no longer maintained. However, we may use start.com in the future to vet new ideas.
3. What do I need to create Windows Live Gadgets? [Up]
You can create a Gadget with just Notepad if you want to. However, it would be helpful if you have a proper IDE such as Visual Studio 2005 or Visual Web Developer Express to help in writing code and debugging. To write a Gadget, you will also need to have a basic knowledge of HTML, CSS and JavaScript. For a primer in these topics, take a look at the Resources section.
4. What is an inline Gadget? [Up]
By default, all third party Gadgets are sandboxed into an IFRAME for security reasons, and they are loaded from the Start.com domain. Inline Gadgets are Gadgets that are not sandboxed inside an IFRAME, loads directly onto the page and are loaded from the Live.com domain. Currently, only Microsoft internal or partner certified Gadgets can be inline Gadgets. Inline Gadgets have access to the page's DOM and cookies on the Live.com domain. They also have access to additional API that deal with the Gadget header and footer.
5. Will my Windows Live Gadget work on the Sidebar? [Up]
Not currently, but this is something we are currently working on to enable. Stay tuned for more information.
6. How do I work with themes? [Up]
Gadgets don't currently support themes. This is something we are committed to supporting in a future release of the SDK. In the meantime we recommend that you set the background of your gadget to be transparent. This will allow the background theme of your gadget host to be visible in your gadget. In addition we suggest that you allow a font color value to be set in preferences that allows the gadget font color to be set to a color that doesn't clash with the theme background color.
7. How do I add icons to the title bar of my gadget? [Up]
This is currently not supported for 3rd party gadgets.
Coding Questions: How Do I...
1. How do I get started with writing Gadgets? [Up]
The Windows Live Gadget Developer's Guide is the best place to get started with writing Windows Live Gadgets.
2. What APIs are available? [Up]
The API reference for Windows Live Gadgets can be found here. Please note that we are still in Beta, and the APIs are subject to change. Our current plans for a final release is in late fall of 2006. We currently make no guarantees that these APIs will be stable. In fact, we already know of several upcoming changes. When those APIs become available, they will be made available through the same API reference document above.
3. How do I test my Gadget? [Up]
You can test your Gadget locally on your own web server. For details on how to do this, refer to the Testing & Debugging section of the Windows Live Gadget Developer's Guide.
4. How do I consume a web service in my Gadget? [Up]
There is an example of how a Gadget calls a web service in the Web.Network.createRequest API reference. Please refer to that documentation.
5. How do I store user preferences in my Gadget? [Up]
Use the setPreference, getPreference and deletePreference APIs to manage user preferences within your Gadget. You can use user preferences to store things like stock tickers in a stock quote Gadget, cities in a weather Gadget, or any other data that you need to persist on a per user basis. For more information about them, please see the API reference document.
6. How do I tell what the current locale is in my Gadget? [Up]
You can tell what the current user locale is based on the M_CultureVariable_Text variable. However, this will be deprecated shortly. You can alternatively use module.getLocale().
7. How do I talk to other Gadgets on the same page? [Up]
This is not currently supported for 3rd party Gadgets, because your Gadget is sandboxed in its own IFRAME.
8. How do I get the width of the <div> element that my Gadget lives in? [Up]
You can get the width of the <div> element that your Gadget lives in by doing the following:

   
    var bodyEl = module.getBodyEl();
    alert(bodyEl.offsetWidth);
 

However, you shouldn't need to know the exact width of your Gadget and manually adjust your Gadget content. Whenever you change the contents of your Gadget that may affect its layout, just call module.Resize().
9. How do I enable my Gadget to access services that require Passport authentication? [Up]
This is not currently supported for 3rd party Gadgets, because your Gadget is sandboxed in its own IFRAME.
10. How do I localize my Gadget? [Up]
You can use a switch statement on the return value from module.getLocale(), and display different strings depending on locale. We may have better support for localization in the future.
11. How do I properly scope the CSS for my Gadget? [Up]
CSS declarations must be scoped to the gadget's namespace in order to prevent collisions with other elements on the page. The gadget container will automatically be given a classname which corresponds to the gadget's binding namespace. So, for example, if the gadget binding is "Microsoft.Live.GadgetSDK.NotepadGadget", the gadget container would have className "Microsoft_Live_GadgetSDK_NotepadGadget" ("." is replaced with "_"). CSS declarations can then be scoped as such:

.Microsoft_Live_GadgetSDK_NotepadGadget .TextArea
{
color:black;
}
12. How do I load my gadget from localhost for IE7?[Up]
Problem: Unable to load a gadget with localhost in the manifest URL.
Solution: Set "Access data sources across domains" to "Prompt" specifically for the trusted sites zone (as opposed to Internet zone, which the docs specify). You may want to set your Internet zone setting back to "Disabled".