ImageWidget not taking focus | developer.brewmp.com ImageWidget not taking focus | developer.brewmp.com

Developer

ImageWidget not taking focus

Hi!

I want to use an image which will show behaviour of a button.For this purpose i have used IMAGEWIDGET but it is not getting foucs.when i call iwidget_cantakefocus it is giving some err.Any idea?

Image widgets, by default, cannot take focus. You can override this by adding an event handler with handles EVT_WDG_CANTAKEFOCUS.
-Erik

Image widgets, by default, cannot take focus. You can override this by adding an event handler with handles EVT_WDG_CANTAKEFOCUS.
-Erik

Thanks erik for reply .But i am new to Brew environment , i do not know how to override cantakefocus .Plz tell me the steps to do it and if possible a sample code.
Thanks

Thanks erik for reply .But i am new to Brew environment , i do not know how to override cantakefocus .Plz tell me the steps to do it and if possible a sample code.
Thanks

To override the EVT_WDG_CANTAKEFOCUS, install your own handler for the image widget by calling IWIDGET_SetHandler().
Then in the Handler Function, handle the EVT_WDG_CANTAKEFOCUS and output TRUE.
boolean my_imagewid_hdlr(void* po, AEEEvent evt, uint16 wparam, uint32 dwparam)
{
switch(evt)
{
case EVT_WDG_CANTAKEFOCUS:
*((boolean*)dwParam) = TRUE;
return TRUE;
case EVT_WDG_SETFOCUS:
return TRUE;
default:
break;
}
return HANDLERDESC_Call(.....);

-empeegee

To override the EVT_WDG_CANTAKEFOCUS, install your own handler for the image widget by calling IWIDGET_SetHandler().
Then in the Handler Function, handle the EVT_WDG_CANTAKEFOCUS and output TRUE.
boolean my_imagewid_hdlr(void* po, AEEEvent evt, uint16 wparam, uint32 dwparam)
{
switch(evt)
{
case EVT_WDG_CANTAKEFOCUS:
*((boolean*)dwParam) = TRUE;
return TRUE;
case EVT_WDG_SETFOCUS:
return TRUE;
default:
break;
}
return HANDLERDESC_Call(.....);

-empeegee

Thanks empeegee. It is working. :)

Thanks empeegee. It is working. :)