IupGLText (since 3.19)

Creates an embedded OpenGL text interface element, which displays a text and allows to edit it when clicked. It inherits from IupGLSubCanvas. It exists only inside an IupGLCanvasBox.

Internally uses an IupText when the user clicks the control to allow the user to edit the text. Once the IupText loses its focus the text is updated and the IupText is hidden. The IupText is an internal child of the IupGLText. The application can use the IupGetChild function to get access to the IupText control.

Creation

Ihandle* IupGLText(void); [in C]
iup.gltext{} -> (elem: ihandle) [in Lua]
gltext() [in LED]

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

Attributes

The IupGLText 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: "ALEFT:ATOP". Partial values are also accepted, like "ARIGHT" or ":ATOP", the other value will be obtained from the default value. When editing only horizontal alignment is used.

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

PADDING (non inheritable): internal margin. Default value: "2x2".

CPADDING: same as PADDING but using the units of the SIZE attribute. It will actually set the PADDING attribute. (since 3.29)

SIZE (non inheritable): Since the contents can be changed by the user, the Natural Size is not affected by the text contents. Use VISIBLECOLUMNS and VISIBLELINES to control the Natural Size.

TEXT (non inheritable): returns the name of the internal IupText used to edit the text when the user clicks the control. Another way to get access to the internal child IupText.

TEXT_HANDLE (non inheritable): returns the Ihandle of the internal IupText.

VALUE (non inheritable): Text entered by the user.

VISIBLECOLUMNS: Defines the number of visible columns for the Natural Size, this means that will act also as minimum number of visible columns. It uses a wider character size than the one used for the SIZE attribute so strings will fit better without the need of extra columns. As for SIZE you can set to NULL after map to use it as an initial value. Default: 5

Callbacks

The IupGLText element handle all callbacks defined for the IupGLSubCanvas control.


VALUECHANGED_CB: Called after the value was interactively changed by the user.

int function(Ihandle *ih); [in C]
elem:valuechanged_cb() -> (ret: number) [in Lua]

ih: identifier of the element that activated the event.

Notes

Visually the difference between an IupGLText and an IupGLButton is that by default the border is always visible in the IupGLText.

See Also

 IupGLLabel, IupGLButton, IupGLToggle.