Label Control

From DevWiki

Jump to: navigation, search

Applications,Boxee GUI API,Controls



Label controls are used to display text on the window and in other controls such as lists. Label properties include font, size, color, etc. The text displayed can be set statically or changed dynamically using the python api. Multiline labels have two variations, either by inserting a new line character in the label text or setting the <wrapmultipine> tag to true. In either case, its important to set the height appropriately as labels currently do not auto grow depending on content.


  1. <control type="label" id="110">
  2.    <description>some label that shows text</description>
  3.    <posx>280</posx>
  4.    <posy>100</posy>
  5.    <width>250</width>
  6.    <height>40</height>
  7.    <align>left</align>
  8.    <aligny>center</aligny>
  9.    <scroll>false</scroll>
  10.    <label>Some text goes here</label>
  11.    <number></number>
  12.    <haspath>false</haspath>
  13.    <font>font23</font>
  14.    <textcolor>white</textcolor>
  15.    <shadowcolor>grey</shadowcolor>
  16.    <wrapmultiline>false</wrapmultiline>
  17. </control>

Available Tags

In addition to the Default Control Properties the following tags are available. Note that all XML tags are in lower case.

Element Description Required
label Specifies the text showed in the label. It can be a link into strings.xml, or an actual text label. For more than once piece of information use the $INFO and $LOCALIZE formats. Yes, if <info> not specified.
info Specifies the information showed in the label taken from strings.xml or as a GUI information. Yes, if <label> not specified.
number Specifies a number to show in the label. No
font Font used for the button label. Default is Boxee default font. See Boxee Fonts. No
textcolor Color used for displaying the button label. In AARRGGBB hex format or a name from the skin color themes. See GUI Documentation No
shadowcolor Specifies the color of the drop shadow on the text. In AARRGGBB hex format or a name from the skin color themes. No
angle The angle the text should be rendered at, in degrees. A value of 0 is horizontal. No
align Label horizontal alignment on the button. Defaults to left, can also be center or right. No
aligny Label vertical alignment on the button. Defaults to top, can also be center. No
scroll When true, the text will scroll if longer than the label's <width>. If false, the text will be truncated. Defaults to false. No
scrollspeed Scroll speed of text in pixels per second. Defaults to 60. No
wrapmultiline If true, any text that doesn’t fit on one line will be wrapped onto multiple lines. Defaults to false. No
haspath Specifies whether or not this label is filled with a path. Long paths are shortened by compressing the file path while keeping the actual filename full length. No

Python Integration

The label class represents a label control in the user interface.

  1. myLabel = mc.GetActiveWindow().GetLabel(140)
  1. <onclick lang="python"><![CDATA[
  2. myLabel = mc.GetActiveWindow().GetLabel(140)
  3. ]]></onclick>


Sets/changes the label text.

  1. myLabel.SetLabel('Play')
Personal tools