Introduction
Containers Layouts Widgets Miscellaneous

Widgets -> label

To create a label, use the following syntax:

$l = label("Text" [, properties]);

Instead of plain text strings, the text can also be in HTML code. For example:

$htmlString = '<html>This is <b>bold</b> and <i>italic</i> and <u>underline</u>.</html>';
$mylabel = label($htmlString);
# add $mylabel to some container..

However, HTML support is limited to HTML3.2 only. Images can also be shown (in labels, radiobuttons, checkboxes and buttons) using HTML tags. To specify an image source, the tag is:

$str = '<html><image src=file:somefile.jpg></html>';
$l = label($str);
# Replace the bolded "somefile.jpg" to the actual image filename you want.

Properties

NameArgumentsDescExample
align LEFT, CENTER, or RIGHT Specifies the horizontal alignment of text. -
valign TOP, CENTER, or BOTTOM Specifies the vertical alignment of text. -
state 1 or 0 Specifies the initial state of the label. 1 is enabled (also the default), and 0 is disabled. $l = label('Text', 'state=0');
font fontsize fontname This specifies the font of the label. A font size MUST be specified along with the font name. $l = label('Text', 'font=14 Times New Roman');
fontstyle BOLD, ITALIC or NORMAL This specifies the font style of the label. This MUST be used with the font property above. $l = label('Text', 'font=14 Times New Roman', 'fontstyle=BOLD');
bounds x y w h See Absolute Positioning for more info. -

These properties are optional and can be in any order.

Related commands and functions

enable($label)Self-explanatory.
disable($label)Self-explanatory.
- End of page -
Hosted by www.Geocities.ws

1