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

Developer

Forums

Forums:

how to read the text on a button? I want to get the text dispkayed on a button. Please help

Hi annu,
The button is a Decorator that will be wrapped around a Text Widget (in your case). Retrieve the Text Widget from the button and, following that, call IWidget_GetTextWidgetText() to retrieve the text.
Regards,
Anand

Hi annu,
The button is a Decorator that will be wrapped around a Text Widget (in your case). Retrieve the Text Widget from the button and, following that, call IWidget_GetTextWidgetText() to retrieve the text.
Regards,
Anand

In Brew, I used to create buttons with text like this:
ISHELL_CreateInstance(pShell, AEECLSID_StaticWidget, (void**) &pWidget);
IWIDGET_SetText(pWidget, pTextLabel, false);
Life was good. Now, in BMP I'm doing this:
ISHELL_CreateInstance(pShell, AEECLSID_ButtonWidget, (void**) &pWidget);
IWidget* piwText;
IWidget_QueryInterface(pWidget, AEEIID_WIDGET, (void**) &piwText);
IWidget_SetTextWidgetText(piwText, pTextLabel);
IWidget_Release(piwText);
Not so good. The text on the button never appears. I've stepped through it and everything seems OK. All of the calls return success, but still not text. I must be doing something wrong.
Thanks for the help!

In Brew, I used to create buttons with text like this:
ISHELL_CreateInstance(pShell, AEECLSID_StaticWidget, (void**) &pWidget);
IWIDGET_SetText(pWidget, pTextLabel, false);
Life was good. Now, in BMP I'm doing this:
ISHELL_CreateInstance(pShell, AEECLSID_ButtonWidget, (void**) &pWidget);
IWidget* piwText;
IWidget_QueryInterface(pWidget, AEEIID_WIDGET, (void**) &piwText);
IWidget_SetTextWidgetText(piwText, pTextLabel);
IWidget_Release(piwText);
Not so good. The text on the button never appears. I've stepped through it and everything seems OK. All of the calls return success, but still not text. I must be doing something wrong.
Thanks for the help!

Listen Button is a decorator. You cant display text on it.
So first create Static widget then Create instance of Button widget.
set the text for Static widget.
then set the button widget with it static widget
IDecorator_SetWidget((IDecorator *)me->piwButton, me->piwLabel );
and now your Button is ready to display text.

Listen Button is a decorator. You cant display text on it.
So first create Static widget then Create instance of Button widget.
set the text for Static widget.
then set the button widget with it static widget
IDecorator_SetWidget((IDecorator *)me->piwButton, me->piwLabel );
and now your Button is ready to display text.