Developer

API Reference

IRootContainer_Insert()

Brew Release
Brew MP 1.0.2
See Also
- IRootContainer Interface
- IWidget Interface
- WidgetPos
- IRootContainer_Remove()
Description
This function allows an application to insert a widget into the root container's widget stack -- at the top of the stack, at the bottom, or some place inbetween. By default, widgets will be inserted at the top of the stack. However, an application may choose to instead insert widgets anywhere within the root container's widget stack by specifying a widget already in the stack as a reference position for placing the new widget.
Parameters
  • pif
    []:
    [in] A pointer to an IRootContainer object.
  • pw
    []:
    [in] Pointer to the widget to be inserted into the root container's widget stack.
  • piwBefore
    []:
    [in] Indicates where in the root container's widget stack that the new widget should be inserted. This value may be expressed as either a pointer to a widget already in the widget stack, in which case the new widget will be inserted immediately before the widget pointed to by 'piwBefore' -- or as a constant that identifies a relative position within the widget stack, as follows WIDGET_ZNORMAL - Allow BREW to place the inserted widget at the default location. For the root container, this places the new widget at the top of container's widget stack. WIDGET_ZTOPMOST - The new widget should be inserted as the topmost widget in the root container's widget stack. WIDGET_ZBOTTOMMOST - The new widget should be inserted at the bottommost widget in the root container's widget stack.
  • ppos
    []:
    [in] Const pointer to a WidgetPos data structure, specifying the location where the widget should be displayed within the root container. This data structure also defines whether or not the widget is currently visible. If 'ppos' is NULL, 'pw' will be inserted at (0,0) with visibility set to TRUE.

Prototype
   int IRootContainer_Insert(IRootContainer *pif,
                              IWidget *pw,
                              IWidget *piwBefore,
                              const WidgetPos *ppos);
Return
   
   AEE_SUCCESS   --  The widget was successfully inserted into the root container's widget stack.
   AEE_EBADPARM  --  The widget pointer passed in 'piwBefore' either does not exist, or refers to a
                     widget that is not in the root container's widget stack.
   ENOMEMORY     --  The widget stack could not grow to accommodate a new widget.

Side Effect
None
Comment
Do not forget to set the extent of widget's inserted to a Root Container! All widgets are initially created with an extent of 0x0. If you create a widget and insert it to a Root Container without setting its extent it will not be visible
  • Follow