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

Developer

Forums

I have have created radio widget group. Now I want to set the value for it.
i am calling IVALUMODEL_SetBool, which needs IValueModel pointer but IWIDGET_GetViewModel gives IModel pointer. So how to convert
Model pointer to IValueModel pointer.

Code is like this:

ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_RADIOWIDGET,(void**)&pMe->GenderMale);

IWIDGET_GetViewModel(pMe->CheckGenderMale,&pMe->Model);

ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_RADIOWIDGET,(void**) &pMe->GenderFemale);

IWIDGET_SetViewModel(pMe->CheckGenderFemale,pMe->Model);

//IVALUEMODEL_SetBool(pMe->Model,FALSE); (if called with IModel* give access voilation error).

Can anybody help me..

Thanx in advance.

--Mangesh

Hi Mangesh,
Add a listener to your view model and it should work fine.
Thanks & Regards
Paresh Purabhiya

Hi Mangesh,
Add a listener to your view model and it should work fine.
Thanks & Regards
Paresh Purabhiya

pMe->Model is the radio button view model. A view model does not contain data. A widget will send events to its view model when the widget changes how it is being displayed.
You want to use IWIDGET_GetModel() to get the widget's data model, which in this case is an IValueModel. You can then use IVALUMODEL_SetBool() on that model.
-Erik

pMe->Model is the radio button view model. A view model does not contain data. A widget will send events to its view model when the widget changes how it is being displayed.
You want to use IWIDGET_GetModel() to get the widget's data model, which in this case is an IValueModel. You can then use IVALUMODEL_SetBool() on that model.
-Erik