IupGLLabel (since 3.11)

Creates an embedded OpenGL label interface element, which displays a text and/or an image. It inherits from IupGLSubCanvas. It exists only inside an IupGLCanvasBox.


Ihandle* IupGLLabel(const char *title); [in C]
iup.gllabel{[title = title: string]} -> (elem: ihandle) [in Lua]
gllabel(title) [in LED]

title: Text to be shown on the label. It can be NULL. It will set the TITLE attribute.

Returns: the identifier of the created element, or NULL if an error occurs.


The IupGLLabel element handle all attributes defined for a IupGLSubCanvas control.

ALIGNMENT (non inheritable): horizontal and vertical alignment. Possible values: "ALEFT", "ACENTER" and "ARIGHT",  combined to "ATOP", "ACENTER" and "ABOTTOM". Default: "ACENTER:ACENTER". Partial values are also accepted, like "ARIGHT" or ":ATOP", the other value will be used from the current alignment.

FGCOLOR: Text color. Can have an alpha component. Default: "0 0 0".

IMAGE (non inheritable): Image name. Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. See also IupImage.

IMAGEHIGHLIGHT (non inheritable): Image name of the element in highlight state. If it is not defined then the IMAGE is used.

IMAGEINACTIVE (non inheritable): Image name of the element when inactive. If it is not defined then the IMAGE is used and its colors will be replaced by a modified version creating the disabled effect.

IMAGEPRESS (non inheritable): Image name of the element in pressed state. If it is not defined then the IMAGE is used.

IMAGEPOSITION (non inheritable): Position of the image relative to the text when both are defined. Can be: LEFT, RIGHT, TOP, BOTTOM. Default: LEFT.

PADDING (non inheritable): internal margin. Default value: "0x0".

SPACING (non inheritable): defines the spacing between the image and the title. Default: "2".

TITLE (non inheritable): Label's text. The '\n' character is accepted for line change.


The IupGLLabel can contain text and image simultaneously.

The natural size will be a combination of the size of the image and the title, if any, plus PADDING and SPACING (if both image and title are present).

See Also

IupImage, IupGLButton, IupGLToggle.