Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - get name widget in action : (2 Items)
   
get name widget in action  
Hi I have widgets: PtText1,PtText2,PtText3 ... and i want use the same function on each widgets. The function must get 
name widget for example PtText1 split this String and return only numer in this case "1". And get value from PtText1(for
 example "0") and set this value in variable like this pgmData[1] = 0; 

int 
myfunction(PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo) 
{ 

PtSetArg(&arg[0],Pt_ARG_TEXT_STRING,&textp,0); 
PtGetResources(ABW_PtText1,1,arg); 

pgmData[???] = ??? 


widget = widget,apinfo = apinfo,cbingo = cbinfo; 
return(Pt_CONTINUE); 
}
Re: get name widget in action  
Take a look at  ApInstanceName() ; it will return the widget instance's name you provided to PhAB.

Though this will work (if you instruct PhAB to store the instance names), I personally prefer using the Pt_ARG_USER_DATA
 instead of the instane name in such cases.

- Thomas