Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Hello friends,

as everyone is getting into BUIT and BUIW, lets start a thread where we can get our basics clear on some apis used

I have some doubts regarding few apis used in Calculator, hope someone can help me out

1. IWIDGET_GetModel(pickItemWidget, AEEIID_VALUEMODEL, (IModel**)&pickItemValueModel);

(these lines are copied from Calculator example from BUIT)

could someone please elaborate on why we need to do getmodel (why cant we just use setmodel as it is done in some cases):confused: :confused:

thanks in advance
Viral

When a widget is created it automatically creates a model. In most cases it's easier to get the widget's model than to create a new model and give it to the widget.
-Erik

When a widget is created it automatically creates a model. In most cases it's easier to get the widget's model than to create a new model and give it to the widget.
-Erik

I think in most cases where the Widget uses Valuemodel , it is automatically created so that it can be retrieved and worked upon immediately.
But in cases like List Widget which needs a vectormodel, we need to create it separately since its not created automatically and set it as a model to the List Widget.
P.S - Erik correct me if am wrong .

I think in most cases where the Widget uses Valuemodel , it is automatically created so that it can be retrieved and worked upon immediately.
But in cases like List Widget which needs a vectormodel, we need to create it separately since its not created automatically and set it as a model to the List Widget.
P.S - Erik correct me if am wrong .

Interestingly enough, when a list widget is created it creates an IListModel as its model. Now an IListModel is completely useless since it doesn't have a Set function. So you must create a model which is a subclass of IListModel (IArrayModel, IVectorModel, or IMenuModel) and set that on the list widget.
-Erik

Interestingly enough, when a list widget is created it creates an IListModel as its model. Now an IListModel is completely useless since it doesn't have a Set function. So you must create a model which is a subclass of IListModel (IArrayModel, IVectorModel, or IMenuModel) and set that on the list widget.
-Erik