View topic - get name widget in action

get name widget in action

anything that doesn't fit to other groups.

get name widget in action

Postby d1gger » Wed Jun 09, 2010 8:16 pm

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);
}
d1gger
New Member
 
Posts: 8
Joined: Thu May 27, 2010 7:52 pm

RE: get name widget in action

Postby maschoen » Sun Jun 13, 2010 1:18 pm

All widgets have a generic "data" resource. You could set this resource, for example to 1 for PtText1 at initalization time and read it back in your function. An alternative would be to have a callback for each widget. That callback would call your function but with a fourth parameter.
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron