Developer

API Reference

IInterfaceModel_AddListener()

Brew Release
Brew MP 1.0.2
Description
This function allows objects such as widgets and UI controls to attach a listener to the given interface 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. To illustrate, consider a widget that displays bitmap images. The widget would use the IInterfaceModel to model the data, stored as a bitmap. The bitmap widget would register as a listener for the IInterface model by calling IInterfaceModel_AddListener(). As the model learns of changes to the bitmap data, the interface model would send out notifications to any registered object -- in this case, to the bitmap widget, which could then redraw itself to accurately portray the updated image.
Parameters
  • p
    []:
    [in] Pointer to the IInterfaceModel 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.
Prototype
   int IInterfaceModel_AddListener(IInterfaceModel *p, ModelListener pl); 
Return
   AEE_SUCCESS          - Listener successfully added
   AEE_EBADPARM         - Invalid argument
   ENOMEMORY            - Insufficient memory
Side Effect
None
Comment
None
  • Follow