label class Displays text or an image
Inherits
object widget
Description
This widget can be used to display a text or an image. It can have different frame styles and text/image alignment.
Functions

`$setText(<text:string>)`
Sets the text to be displayed by the label. The text can contain limited HTML tags. See also $text().
`<string> $text()`
Returns the text currently displayed by the label. See also $setText().
`<integer> $margin()`
Returns current value of margin for this label (default is 0). See also $setMargin().
`$setMargin(<margin:uint>)`
Sets margin width / height to <margin>. See also $margin().
`<string> $alignment()`

Returns a string containing alignment flags that are set for this label. The flags are separated by commas.
An example output could look like this:

    Bottom, Right

See $setAlignment() for explanation of all alignment flags.

`$setAlignment(<flag1:string>, <flag2:string>, ...)`

This function sets alignment flags, given as parameters, for this label. Valid flags are:

     Right     - Text is aligned to right border
     Left      - Text is aligned to left border
     Top       - Text is aligned to the top border
     Bottom    - Text is aligned to the bottom border
     HCenter   - Text is horizontally centered
     VCenter   - Text is vertically centered
     Center    - Equals HCenter + VCenter
     Justify   - Text is spaced apart to cover available room

It is obvious that you can not set Right and Left simultaneously - this will not result in an error message - it will simply not work :)

`$clear()`
Clears the label. Equal to calling $setText("")
`<string> $frameStyle()`

Returns a string containing this label's frame-style flags, separated with commas. Output from this function could look like this:

    Panel, Raised

See $setFrameStyle() for a list of all frame-style flags and their explanation.

`$setFrameStyle(<flag1>, <flag2>, ...)`

Sets the frame-style flags to the ones passed as arguments. The flags determine the shape or shadow of the label's frame. Valid shape flags are:

     NoFrame   - Draw no frame. You shouldn't specify a shadow when using this.
     Box       - Draws a rectangular box. Its borders can be Raised or Sunken
     Panel     - Draws a rectangular panel which can be Raised or Sunken
     WinPanel  - Similar to Panel, but is more in Win95 style
     Hline     - Draws a horizontal line that frames nothing (useful as separator)

Valid shadow flags are:

     Plain     - No 3D effect (draws using foreground color)
     Raised    - Makes the label look like it was raised above the parent widget
     Sunken    - Makes the label look like it was pushed inside the parent widget

`$setImage(<image_id>)`
Sets the image to be displayed on this label. Giving empty argument clears the pixmap. See the image identifier documentation for the explanation of the <image_id> parameter.

Index, Object Classes