Expand/Shrink

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()
gLabel
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.
Expand/Shrink