# 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
     WordBreak - Enables automatic word breaking
It is obvious that you can not set for example Right and Left simoultaneously - this will NOT result in an error message - this 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 explenation.
`$setFrameStyle(<flag1>, <flag2>, ...)`
Sets the frame-style flags to the ones passed as arguments. The flags can either decide of 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 explaination of the <image_id> parameter.

Index, Object Classes

KVIrc 4.2.0.6190 Documentation
Generated by nobody at Thu May 29 11:24:48 2014