Developer

API Reference

IArrayModel_AddListener()

Brew Release
Brew MP 1.0.2
See Also
ModelListener PFNLISTENER IListModel_AddListener()
Description
This function allows objects such as widgets and UI controls to attach a listener to the given array 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 an array model that manages the storage of SMS messages. Each entry in the array will be the same size (perhaps including information about the sender, time of arrival, and a pointer to the contents of the message). An "SMS widget" could register as a listener by calling IArrayModel_AddListener(). As new SMS messages arrive and are stored into the array 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 SMS widget, for example, as a listener of the array model, might update an indicator showing the number of pending SMS messages.
Parameters
  • p
    []:
    Pointer to the IArrayModel interface object.
  • pl
    []:
    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.
Interface
Prototype
   int IArrayModel_AddListener(IArrayModel *p, ModelListener pl); 
Return
   AEE_SUCCESS          - Listener successfully added
   AEE_EBADPARM         - Invalid argument
   ENOMEMORY        - Insufficient memory
Side Effect
None
Comment
None
  • Follow