API Reference


Brew Release
Brew MP 1.0.2
See Also
- IListModel
- ModelListener
- IListModel_AddListener()
This function allows objects such as widgets and UI controls to attach a listener to the given menu model. The listener includes a callback function that BREW will call whenever the model has changed state, thereby notifying the owner of the listener that data has changed. For example, consider a menu model that manages the items in a popup menu whose items change state depending on some external context. A list widget could register as a listener of the menu model by calling IMenuModel_AddListener(). As the menu items change and are stored into the menu model, BREW will send out notifications to all registered objects, providing them the opportunity to update their display or react in some other manner. The list widget implementing the popup menu, for example, as a listener of the menu model, might update the text of the displayed menu on the fly.
  • pif
    [in] Pointer to the IListModel interface object.
  • pl
    [in] Pointer to the ModelListener that will be attached to the object. The ModelListener will contain the PFNLISTENER callback function BREW will call to notify the registering object of changes to the value model.
   int IMenuModel_AddListener(IListModel *pif, ModelListener pl); 
   AEE_SUCCESS          - Listener successfully added
   AEE_EBADPARM         - Invalid argument
   ENOMEMORY            - Insufficient memory
Side Effect
  • Follow