# gLabel

Definition: | include xpGUI.e gdx id = gLabel([nullable_string title=NULL, ] string attributes="", dword_seq args={})
Description: | Creates a label interface element, which displays a separator, a static text string, or an image. title: Text to be shown on the label, sets the TITLE attribute. For more information on the attributes and args parameters see gSetAttributes(). This is a paranormalised function. (see technicalia) Returns: the identifier of the created element.
pwa/p2js: | Supported.
See Also: | gImage, gButton
Example: |
    -- demo\xpGUI\gLabel.exw
    include xpGUI.e

    gdx lbl = gLabel(`This is a label`),
        box = gHbox({lbl},`MARGIN=13x13`),
        dlg = gDialog(label,`gLabel`,`SIZE=240x80`)
    gShow(dlg)
    gMainLoop()
Notes: | Labels with images, texts or line separators cannot change their behavior after being mapped. But after being mapped the image can be changed for another image, and the text for another text. Drag & Drop attributes and handlers are supported. Some examples can be seen in demo\xpGUI\sample.exw
Attributes: | DEV: few if any of these have been tested/implemented...
ACTIVE | The only difference between an active label and an inactive one is its visual feedback. Possible values: "YES"/true, "NO"/false. Default: true.
TITLE | (non inheritable) Label’s text. If SEPARATOR is not defined before map, then the default behavior is to contain a text. The label behavior cannot be changed after map. The natural size will be larger enough to include all the text in the selected font, even using multiple lines. Note that an gRedraw() may be required after changing the title for all characters to be shown. The '\n' character is accepted for line change. The "&" character can be used to define a mnemonic, the next character will be used as key. Use "&&" to show the "&" character instead of defining a mnemonic. The next control from the label will be activated from any control in the dialog using the "Alt+key" combination. (mnemonic support since 3.0)
also | FONT, EXPAND, MARGIN, SIZE, TIP, VISIBLE.
Technicalia | As this is a paranormalised function, and with no expectation that you should memorise this lot, except maybe "taa", you can assume that all of the following are potentially perfectly valid, with the fairly obvious restrictions that any parameters must be in strict taa-order, and no args without attributes:
                            gLabel()
                            gLabel(title)
                            gLabel(attributes)              -- (see Note too)
                            gLabel(attributes, args)
                            gLabel(title, attributes)
                            gLabel(title, attributes, args) -- (the full set)
Note that in practice attributes is actually defined as sequence, but verified to be of the documented string type, after being repositioned via xpGUI.e/paranormalise_taa(). Note too that gLabel(attributes) is distinguished from gLabel(title) by the presence of an '=' character, see here.