Documentation‎ > ‎Display‎ > ‎

    gnocl::label

    A widget which shows a small amount of text.

    Synopsis

    gnocl::label [-option value...]

    Screenshot

    Options

    -align one of topLeft, top, topRight, left, center, right, bottomLeft, bottom, or bottomRight
    Alignment of the text.
    -data string
    User defined data which can be retrieved via the cget subcommand.
    -heightGroup string (default: "")
    The -heightGroup option can be an arbitrary string. All widgets with the same heightGroup request the same height. If packed with the fill flag set, they will have nevertheless different heights.
    -justify one of left, right, center or fill (default: left)
    Determines the justification of the text lines. Has no effect if the label has only one line of text.
    -maxWidthChars integer
    The maximum size of the widget in characters.
    This option is available since GTK+ 2.6.0
    -mnemonicWidget Wiget-ID (default: "")
    Widget which is activated for keyboard navigation.
    -selectable boolean (default: 0)
    Whether the text can be selected.
    -sensitive boolean (default: 1)
    Whether or not the item is sensitive to user input.
    -sizeGroup string (default: "")
    The -sizeGroup option can be an arbitrary string. All widgets with the same -sizeGroup request the same size. If packed with the fill flag set, they will have nevertheless different sizes.
    -text percent-string (default: "")
    Text of the label.
    -visible boolean (default: 1)
    Whether or not the item is visible.
    -widthGroup string (default: "")
    The -widthGroup option can be an arbitrary string. All widgets with the same -widthGroup request the same width. If packed with the fill flag set, they will have nevertheless different widths.
    -widthChars integer
    Size of the widget in characters.
    This option is available since GTK+ 2.6.0
    -wrap boolean (default: 0)
    Whether the text should be automatically wrapped.
    -xPad integer (default: 0)
    Horizontal padding.
    -yPad integer (default: 0)
    Vertical padding.

    Description

    A label displays a small to medium amount of text. With the help of embedded markup commands the text inside a label can even have different fonts, colours etc.

    Commands

    id cget option
    Returns the value for one option. The option may have any of the values accepted by configure.
    id class
    Return the class for this widget object, i.e. 'label'.
    id configure [-option value...]
    Configures the widget. Option may have any of the values accepted on creation of the widget.
    id delete
    Deletes the widget and the associated tcl command.

    Example

    set label [gnocl::label /
        -text {%<<span foreground="blue">Hello</span><span 
                  Forereground="red">World</span>}]


    gnocl::window /
        -title "Label" /
        -child $label

    Sections