On Apr 28, 9:46 pm, rakesh veeramachaneni <[email protected]> wrote:

> I tried looking for a SetHeight() in the API like SetTitle(), but there
> doesnt seem to be one. Please do let me know if you have any idea to do so.

I have gadgets where I do something similar, and what I do is
explicitly set the height of a major content element (using its style
height), followed by a call to _IG_AdjustIFrameHeight().

First, I have a preference like this:

  <UserPref name="height" display_name="Size" datatype="enum"
default_value="50">
    <EnumValue value="50" display_value="Small" />
    <EnumValue value="100" display_value="Medium" />
    <EnumValue value="200" display_value="Large" />
  </UserPref>

Then in a <style> element in the gadget content, I use the hangman
notation to pull the pref in directly, avoiding the need to use the JS
preferences object:

    <style type="text/css">
    #main {
      height: __UP_height__px;
    }
    </style>

Note that you need to have id="main" on some HTML element that takes
up your entire gadget's size, like a container div. Then all you need
is the  _IG_AdjustIFrameHeight() call in your load event handler, and
you should be all set.

You can see this in action (slightly modified) in 
http://gad.getpla.net/sticky/note.xml.

HTH,

String
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to