Confusion about API examples vs. Dev Docs

40 views
Skip to first unread message

kewarken

unread,
Dec 23, 2009, 4:20:04 PM12/23/09
to google-gadgets-for-linux-user
This may not be specific to the Linux version but I'm having a bit of
a problem.

Say, for example, I look at the examples that come with the API. I
can run the examples doing something like:

/usr/bin/ggl-gtk -sa -nd -gp api/samples/gadgets/HelloWorld

and I get a nice, standalone version of the HelloWorld that I can play
with. I can zip this up into a .gg file and embed it into my desktop
if I want.

I would like to be able to use the gadgets API within these apps,
specifically something like:

var prefs = new gadgets.Prefs();
var lang = prefs.getLang(); // returns ISO 639-1 language code
var country = prefs.getCountry(); // returns ISO 3161-1 alpha 2 code

but when I do, I get:

main.js:24: ReferenceError: gadgets is not defined.

Using the regular examples where you have modules deployed to the web
which look like this:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="hello world example" />
<Content type="html">
<![CDATA[
<insert javascript stuff here>
]]>
</Content>
</Module>

the gadgets.Prefs() works fine. I guess what I want to know is, what
is the difference between projects defined like the above
HelloWorld.xml and projects like a HelloWorld.gg?

cheers,

Kris

James Su

unread,
Dec 23, 2009, 9:53:35 PM12/23/09
to google-gadgets...@googlegroups.com
There are two different kind of gadget from Google, one is called iGoogle gadget (which is also called Google Gadget), another is called Google Desktop Gadget. They are different things, iGoogle Gadgets are for running on your customized google home page, Google Desktop Gadgets are for running by Google Desktop on Windows and GGL on Linux. The HelloWorld you run with ggl-gtk is a Google Desktop Gadget, but the document you read is for iGoogle Gadget.

Hope it makes things clear :-)

Regards
James Su

2009/12/24 kewarken <kewa...@gmail.com>

--

You received this message because you are subscribed to the Google Groups "google-gadgets-for-linux-user" group.
To post to this group, send email to google-gadgets...@googlegroups.com.
To unsubscribe from this group, send email to google-gadgets-for-l...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-gadgets-for-linux-user?hl=en.



Kris Warkentin

unread,
Dec 24, 2009, 8:54:35 AM12/24/09
to google-gadgets...@googlegroups.com
Thanks for that.  It clears things up a bit but there seems to be a certain amount of cross-pollination of the docs.  It seems quite easy to accidentally migrate from one to the other and get the wrong api.

cheers,

Kris
Reply all
Reply to author
Forward
0 new messages