Changing <gtext>.value doesn't update <gtext>.width

Add a gtext element:

bodyText = bodyBackground.addTextObject("This is some text", "Arial", 20, "Black", 0, 0);

Then change the text to something shorter:

bodyText.value = "Text";

And you end up with "Text" streched to fit the original width of "This is some text"!  Surely, it should recalculate <gtext>.width to the width of the new value


Answer this question

Changing <gtext>.value doesn't update <gtext>.width

  • Carsten Kanstrup

    I try to keep track of bugs reported on this forum, but just to be sure, I'd appreciate it if you could send me the list of issues you found - Bruce.Williams@microsoft.com.
  • Karg Weng

    Thanks!
  • MarcD99

    Will, do. I'll create you a load of Repro's as well.

    EDIT: If anyone else is interested in looking at the screenshots or the Repro gadgets, go here.  I'll maintain this list, so we can track known bugs and workarounds.


  • QWERTYtech

    what a funny bug i found a work around try this

    bodyText = bodyBackground.addTextObject("This is some text", "Arial", 20, "Black", 0, 0);
    bodyText.value = "Text";
    bodyText.width = 0;

  • Sarath.

    Well spotted!

    If you want the Gadget (Polaroid) that sparked off all the issues I've recently reported, head here. In the end I opted to remove all the g:background objects and recreate them.

    What was supposed to be a one hour gadget, turned into two days of trying to work around all the bugs I found in Sidebar. I think I found six in the end!

  • Changing <gtext>.value doesn't update <gtext>.width