Expand/Shrink

IupLabel

Definition: include pGUI.e

Ihandle ih = IupLabel(nullable_string title=NULL, string attributes="", dword_seq args={})
Description: Creates a label interface element, which displays a separator, a text or an image.

title: Text to be shown on the label. It can be NULL. It will set the TITLE attribute.
For more information on the attributes and args parameters see IupSetAttributes.

Returns: the identifier of the created element.
pwa/p2js: Supported, but see +x? markers on individual attributes and callbacks.
See Also: IupImage, IupButton IupFlatLabel IupGLLabel
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 callbacks are supported.

Some examples can be seen in demo\pGUI\sample.exw
Attributes:
ACTIVE+ The only difference between an active label and an inactive one is its visual feedback. Possible values: "YES, "NO". Default: "YES".
ALIGNMENT+ (non inheritable) horizontal and vertical alignment.
Possible values: "ALEFT", "ACENTER" and "ARIGHT", combined to "ATOP", "ACENTER" and "ABOTTOM".
Default: "ALEFT:ACENTER".
Partial values are also accepted, like "ARIGHT" or ":ATOP", the other value will be used from the current alignment.
In Motif, vertical alignment is restricted to "ACENTER". (vertical alignment since 3.0)
BGCOLOR ignored, transparent in all systems. Will use the background color of the native parent.
DROPFILESTARGET [Windows and GTK Only] (non inheritable) Enable or disable the drop of files.
Default: NO, but if DROPFILES_CB is defined when the element is mapped then it will be automatically enabled. (since 3.0)
ELLIPSIS [Windows and GTK only] add an ellipsis: "..." to the text if there is not enough space to render the entire string.
Can be "YES" or "NO". Default: "NO". (since 3.0) (GTK 2.6)
FGCOLOR+ Text color. Default: the global attribute DLGFGCOLOR.
IMAGE (non inheritable) Image name.
If set before map defines the behavior of the label to contain an image.
The natural size will be size of the image in pixels.
Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. See also IupImage.
IMINACTIVE (non inheritable) [GTK and Motif only] Image name of the element when inactive.
If it is not defined then the IMAGE is used and the colors will be replaced by a modified version of the background color creating the disabled effect.
GTK will also change the inactive image to look like other inactive objects.
MARKUP [GTK only] allows the title string to contains pango markup commands.
Works only if a mnemonic is NOT defined in the title.
Can be "YES" or "NO". Default: "NO".
PADDING+ internal margin. Works just like the MARGIN attribute of the IupHbox and IupVbox containers, but uses a different name to avoid inheritance problems.
Not used when SEPARATOR is used. Default value: "0x0". (since 3.0)
CPADDING same as PADDING but using the units of the SIZE attribute. It will actually set the PADDING attribute. (since 3.29)
SEPARATOR+ (creation only) (non inheritable) Turns the label into a line separator.
Possible values: "HORIZONTAL" or "VERTICAL".
When changed before mapping the EXPAND attribute is set to "HORIZONTALFREE" or "VERTICALFREE" accordingly.
(Since 3.11 changed to FREE based expand)
TITLE+ (pwa/p2js) (non inheritable) Label’s text.
If SEPARATOR or IMAGE are 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 IupRefresh() 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)
WORDWRAP [Windows and GTK only] enables or disable the wrapping of lines that does not fits in the label.
Can be "YES" or "NO". Default: "NO". Can only set WORDWRAP=YES if ALIGNMENT=ALEFT. (since 3.0)
also FONT+, NAME, EXPAND+, SCREENPOSITION, POSITION, MINSIZE, MAXSIZE, WID, TIP, SIZE+, RASTERSIZE+, ZORDER, VISIBLE?: also accepted.
Callbacks:
BUTTON_CB Action generated when any mouse button is pressed or released. (since 3.3)
MOTION_CB Action generated when the mouse is moved. (since 3.20)
DROPFILES_CB [Windows and GTK Only] Action generated when one or more files are dropped in the element. (since 3.3)
also MAP_CB, UNMAP_CB, DESTROY_CB, ENTERWINDOW_CB, LEAVEWINDOW_CB: common callbacks are supported.
Expand/Shrink