Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Gadgets
Windows Sidebar
text
g:text Element | text Object

Specifies a text element to display in a gadget.

Members Table

The following table lists the members exposed by the text object.

Methods

MethodDescription
addGlow Adds a glow effect to a g:text element.
addShadow Adds a shadow effect to a g:text element.

Properties

PropertyDescription
align Gets or sets the text alignment.
blur Gets or sets the level of blur applied to the g:text element.
brightness Gets or sets the brightness of the g:text element.
color Gets or sets the text color.
font Gets or sets the font name.
fontsize Gets or sets the font size.
height Gets or sets the height of the g:text element.
left Gets or sets the number of pixels from the left edge of the gadget to position the g:text element.
opacity Gets or sets the opacity of the g:text element.
rotation Gets or sets the degree of rotation applied to the g:text element.
top Gets or sets the number of pixels from the top edge of the gadget to position the g:text element.
value Gets or sets the value of the g:text element.
width Gets or sets the width of the g:text element.

Remarks

This element can be declared in the gadget HTML file or created with the addTextObject method from a script file. However, if the element is declared in the HTML file, it will not be accessible from script and will affect the gadget element layout rather than being part of the background.

Important  For Windows 7, when the new <autoscaleDPI> element of the gadget manifest is set to true (for high-DPI support) gadgets should explicitly specify a text size.

This element is not rendered.

This element requires a closing tag.

Examples

This example shows how to declare a g:text element in the gadget HTML file.

<g:text id="txtTest">test</g:text>

This example shows how to create a g:text element in a gadget script file.

\\ imgBackground is the value of the 'id' attribute for the g:background element.
var txtShadow = imgBackground.addTextObject("test", "Verdana", 25, "Red", 50, 50);
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
addTextObject      imess   |   Edit   |   Show History
The documentation should read:
This element can be declared in the gadget HTML file or created with the addTextObject method from a script file.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker