Developer

API Reference

IWidget_ReleaseItemWidget()

Brew Release
Brew MP 1.0.2
See Also
- IWidget_GetItemWidget
- EVT_MDL_IDX_WIDGET_CHANGE
Description
This function releases a widget that was acquired using the IWidget_GetItemWidget function. Applications should call this function when they no longer plan on using the requested widget. Please note that function IWidget_ReleaseItemWidget should be called on ListContainer widget not on the widget that represents the index.
If the application gets a EVT_MDL_IDX_WIDGET_CHANGE model change notification, then there has been a possible change to the widget/index assignment in the ListContainer, so all previously acquired widgets (acquired using IWidget_GetItemWidget) should be released with the IWidget_ReleaseItemWidget function.
Parameters
  • pif
    []:
    [in] Pointer to the IWidget interface object.
  • piw
    []:
    [in] Pointer to item widget which needs to be released.
Prototype
   int IWidget_ReleaseItemWidget(IWidget *pif, IWidget *piw)
Return
   AEE_SUCCESS     - Item widget was successfully released.
   AEE_EFAILED     - Item widget was not released.
Side Effect
None
Comment
It is important to note that if caching is enabled, and any changes have been made to a widgets visual appearance, then once IWidget_ReleaseItemWidget() has been called it is possible the widget will end up in the cache. A widget, in the cache, who’s visual structure has been changed is not ideal because when the widget is reused it will result in a list item looking differently than expected. If widgets are ending up in the cache with visual appearance changes then it is suggested that the user add a listener to the widget model so than when the widget is reused, and a new model is assigned, the listener callback function can undo any visual changes made to the widget.
  • Follow