I am not sure I understand, but here it goes.
Using appbuilder :
Lets say you created 3 button, you have set their names to Button_1,
Button_2 and Button_3 and set their Pt_ARG_TEXT_STRING to “button 1”,
"button 2"and “button 3”. Lets now say you have attach to same
Pt_CB_ACTIVATE callback to each button. Now you need to find out witch
button was press.
int My_ActiveCB(PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
*cbinfo )
{
char *button_text ;
// the easy way is to use the widget pointers
if( widget == ABW_Button_1 )
{
// then button 1 was press
}
else if( widget == ABW_Button_2 )
{
// then button 2 was press
}
else if( widget == ABW_Button_3 )
{
// then button 3 was press
}
// you could also you the widget names
if( ApName( widget ) == ABN_Button_1 )
{
// then button 1 was press
}
else if( ApName( widget ) == ABN_Button_2 )
{
// then button 2 was press
}
else if( ApName( widget ) == ABN_Button_3 )
{
// then button 3 was press
}
// or you could make it look complicated ( to justified your salary )
if(ApGetWidgetPtr(ApGetInstance(widget),ABN_Button_1) == widget)
{
// then button 1 was press
}
else if(ApGetWidgetPtr(ApGetInstance(widget),ABN_Button_2) == widget)
{
// then button 2 was press
}
else if(ApGetWidgetPtr(ApGetInstance(widget),ABN_Button_3) == widget)
{
// then button 3 was press
}
// you could also use the widget text
PtGetResource( widget, Pt_ARG_TEXT_STRING, &button_text, 0 );
if( !strcmp( button_text, “button 1” ))
{
// then button 1 was press
}
else if( !strcmp( button_text, “button 2” ))
{
// then button 2 was press
}
if( !strcmp( button_text, “button 3” ))
{
// then button 3 was press
}
// I can probably come up with a couple more !
}