Developer Tips & Tricks - Gadget Fundamentals, Part 3

September 28, 2011

In my last post I alluded to an id UserPref that is required when adding support for the Play, Pause and Stop commands. So, where DOES the value of id come from? It is actually one of a few different parameters whose values are automatically passed to the Gadget by the Viewer. The other parameters are rsW and rsH.

Get started with Rise Vision

id, as you have probably already guessed, is the unique ID of the Gadget. There are usually multiple Gadgets in a Presentation, so each Gadget is assigned an id that the Viewer can use to distinguish between them. Any Gadget that intends to communicate with the Viewer must support this parameter. That pretty much means that you should always support it, since you'll need to tell the Viewer when the Gadget is Ready, for example. Here is what this UserPref might look like:

 

rsW and rsH indicate the width and height (in pixels) of the Placeholder into which the Gadget has been placed. Keep in mind that rsW and rsH return a unitless number. The UserPrefs for these might look something like this:

 

You can access these in the same way you would any other user preference.

Stay tuned for the next edition of Developer Tips & Tricks, where we will dive into the wonderful world of font and color selectors!