IUP-Go Documentation 4.0

IupGLBackgroundBox

Creates a simple native container with no decorations, but with OpenGL enabled. It inherits from IupGLCanvas.

Identical to the IupBackgroundBox element, but with OpenGL enabled.

In GNUstep, the child elements are not visible: the OpenGL surface is an X window that covers the controls drawn in the dialog.

Initialization and Usage

The IupGLCanvasOpen function must be called after IupOpen. The "iupgl.h" file must also be included in the source code. The program must be linked to the GL library (iupgl) and the OpenGL library.

Creation

Ihandle* IupGLBackgroundBox(Ihandle* child);

child: Identifier of an interface element which will receive the box. It can be NULL.

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

Attributes

Inherits all attributes and callbacks of the IupGLCanvas, but redefines a few attributes.

BGCOLOR: by default, will use the background color of the native parent, but can be set to a custom value.

BORDER (creation-only): the default value is "NO".

CANVASBOX (non-inheritable): enable the behavior of a canvas box instead of a regular container. This will affect the EXPAND attribute, the Natural size computation, and child layout distribution. Can be YES or NO. Default: "NO".

CHILDOFFSET (non-inheritable): Allow to specify a position offset for the child. Available for native containers only. It will not affect the natural size, and allows to position controls outside the client area. Format "dxxdy", where dx and dy are integer values corresponding to the horizontal and vertical offsets, respectively, in pixels. Default: "0x0".

DECORATION (non-inheritable): Enable a decoration area around the child. Can be YES or NO. Default: "NO".

DECORSIZE (non-inheritable): total size of the decoration in the format "WidthxHeight" (in C "%dx%d"). Used only when DECORATION=YES.

DECOROFFSET (non-inheritable): decoration offset from a left border and top border in the format "XxY" (in C "%dx%d"). Used only when DECORATION=YES.

EXPAND (non-inheritable): behaves as a container. See CANVASBOX attribute.

CANFOCUS (non-inheritable): the default is changed to NO. But it can receive the focus.

CLIENTSIZE, CLIENTOFFSET: also accepted.

Notes

The box can be created with no elements and be dynamically filled using IupAppend or IupInsert.

The ACTION callback can be defined, and the application can draw below other children inside the GLBackgroundBox, but only with the OpenGL API. Children should be inside native containers to avoid overlapping the drawing areas.

Examples

Browse for Example Files

GTK Qt Win32 macOS