Tuesday, May 15, 2012

Google Desktop to be discontinue

As from September the 14th 2012 Google decided to discontinue the Google Desktop product and is no longer available. You can still download the software (the last version was 5.9.911.3589) but there will be no supports or updates for the Google Desktop since the discontinuation.

The information on this blog will however remain for the future. Thank you for your interest in this blog, the information about- and the software Google Desktop.

You can read the full statement form Google here.

Wednesday, November 5, 2008

Tip, Finding out user idleness.

When the user is not currently at the computer it can be a good idea to ignore some functions. You can find out if the user is in idle state with a framework method, framework.system.user.idle. That method will return a Boolean value, true or false. If the user is idle it'll return true.

For example:

//The user is in idle state
//The user is not in idle state

Tuesday, November 4, 2008

To access elements and childs from Javascript to your XML

You'll probably already know how to access an element from Javascript, By it's name. But what if you added a dynamic elements from Javascript and then wanted to access them all again? One by one, by the names? Sounds harsh. The solution is to loop through the all. This can be done in several ways but I'm going to show you one.
If you have a combobox in your gadget and add dynamic items and labels to it by the method appendString. It's impossible then to access them by name as they don't have one yet. But imagine this, we write a combobox in the XML file like this:

<combobox name="cb"
height="100" width="125"

Then we fill the combobox with items containing labels from javascript coding:

for(var i = 0; i < array.length; i++)

An array with names will be filling the combobox here, the result in xml would look like this:

<label>Name 1</label>
<label>Name 2</label>

Now, how do we do if we want to put a property to the labels, lets say a different size? By this, from javascript again:

for(var i = 0; i < cb.children.count; i++)
element = cb.children.item(i).children.item(0);
element.size = 7;

By the children property we can access all elements to the combobox and then access that particular item. You see you have to first get the children of the combobox and that are the <item> elements, from there we have to access their children and they are the <label> elements. There are other ways to access elements in the XML file from javascript, this was one way. Instead of writing item(i) or item(0) you can access a child by it's name by writing the name instead item("childName"). Also you can use the enumerator object.

Monday, November 3, 2008

Making your gadget interactive with the web

Offline gadgets are cool but sometimes you may want to interact the web with your gadget, request or send data to and from your gadget to some server. Gadgets can be very powerful with some simple Ajax functionality. With the XMLHttpRequest (XHR) object this can make it all possible. It's not hard to implement and neither to use.

I'm not going to explaine how it works, there is a very well written article to be found here explaining what it does and how, code snippets to use.

Gadget Designer

Gadget Designer is a tool, an IDE or Integrated Development Environment for creating a Google Desktop gadget. The tool will help you build a desktop gadget and provide a WYSIWYG for the UI and instead of running it in the sidebar you can use the tool to directly run it in the tool. The Gadget designer comes with the SDK.

Using the tool is better than working in Worpad. The most value about the tool is probably that you can run the Gadget directly with the program, that will safe you some time. Not all the times are the Gadget designer compatible to run your gadget or even render your UI, one example could be when you are using an element. And soon you'll have to write most of it's functionality in code mode. There are improvements to be made but it's very nice anyhow that you'll get a designer tool with your SDK.

Another nice thing about the tool is that you can debug your gadget while it's running. Using a trace method write this "gadget.debug.trace(string)". That will show a trace message in the console and when you have debug console active.

Desktop Gadget Designer