version 2.8
Container

Detailed Description

Basic container.

A Container is a GWindow that supports child windows. It is also a widget in its own right and therefore can accept user input directly.

Precondition
GFX_USE_GWIN and GWIN_NEED_CONTAINERS must be set to TRUE in your gfxconf.h

Modules

 Renderings
 Built-in rendering functions for the container widget.
 

Functions

GHandle gwinGetFirstChild (GHandle gh)
 Get the first child window. More...
 
GHandle gwinGetSibling (GHandle gh)
 Get the next child window in the z-order. More...
 
coord_t gwinGetInnerWidth (GHandle gh)
 Get the inner width of a container window. More...
 
coord_t gwinGetInnerHeight (GHandle gh)
 Get the inner height of a container window. More...
 
GHandle gwinGContainerCreate (GDisplay *g, GContainerObject *gw, const GWidgetInit *pInit, uint32_t flags)
 Create a simple container. More...
 
typedef GWidgetObject GContainerObject
 The GWIN Container structure. More...
 
#define GWIN_CONTAINER_BORDER   0x00000001
 Flags for gwinContainerCreate() More...
 

Function Documentation

GHandle gwinGContainerCreate ( GDisplay *  g,
GContainerObject gw,
const GWidgetInit pInit,
uint32_t  flags 
)

Create a simple container.

Returns
NULL if there is no resultant drawing area, otherwise a window handle.
Parameters
[in]gThe GDisplay to display this window on
[in]gwThe GContainerObject structure to initialise. If this is NULL the structure is dynamically allocated.
[in]pInitThe initialisation parameters
[in]flagsSome flags, see notes
Function Class:
Normal API, this function can be invoked by regular system threads.
GHandle gwinGetFirstChild ( GHandle  gh)

Get the first child window.

A comment/rant on the above structure: We would really like the GWidgetObject member to be anonymous. While this is allowed under the C11, C99, GNU and various other standards which have been around forever - compiler support often requires special flags e.g gcc requires the -fms-extensions flag (no wonder the language and compilers have not really progressed in 30 years). As portability is a key requirement we unfortunately won't use this useful feature in case we get a compiler that won't support it even with special flags.

Returns
The first child or NULL if are no children windows
Parameters
[in]ghThe parent container or NULL to get the first top level window
Function Class:
Normal API, this function can be invoked by regular system threads.
coord_t gwinGetInnerHeight ( GHandle  gh)

Get the inner height of a container window.

Returns
The inner height of a container window or zero if this is not a container
Parameters
[in]ghThe window
Function Class:
Normal API, this function can be invoked by regular system threads.
coord_t gwinGetInnerWidth ( GHandle  gh)

Get the inner width of a container window.

Returns
The inner width of a container window or zero if this is not a container
Parameters
[in]ghThe window
Function Class:
Normal API, this function can be invoked by regular system threads.
GHandle gwinGetSibling ( GHandle  gh)

Get the next child window in the z-order.

Returns
The next window or NULL if no more children
Parameters
[in]ghThe window to obtain the next sibling of.
Note
This returns the next window under the current parent window. Unlike gwinGetNextWindow() it will only return windows that have the same parent as the supplied window.
Function Class:
Normal API, this function can be invoked by regular system threads.

Macro Definition Documentation

#define GWIN_CONTAINER_BORDER   0x00000001

Flags for gwinContainerCreate()

Definition at line 106 of file gwin_container.h.

Typedef Documentation

The GWIN Container structure.

Note
A container is a GWIN widget that can have children.
Do not access the members directly. Treat it as a black-box and use the method functions.

Definition at line 35 of file gwin_container.h.