PtRaw widget creation at run time

I would like to know if it is possible to create PtRaw widget at run time.
Suppose i have a window with several widget of PtRaw type all contained in a
widget of type PtOSContainer. I want delete one of the widgets and adding a
new one.
Is it possible ?

Bye,

Andrea

Hello Andrea,

Sure this is possible. You can simply setup the arguments you want and then
use the PtCreateWidget() and PtRealizeWidget() to make your new widget
visible.
Here is a small example that I had attached to a button click callback.

/*****************/
PtWidget_t *mywidget;

int
CreateRawWidget( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
*cbinfo )
{
int numargs = 0;
PtArg_t args[10];
PhArea_t area;

area.pos.x = area.pos.y =0;
area.size.w = area.size.h =30;
PtSetArg( &args[numargs++], Pt_ARG_AREA, &area, 0);
PtSetArg( &args[numargs++], Pt_ARG_FILL_COLOR, Pg_BLUE, 0);
mywidget = PtCreateWidget( PtRaw, ABW_OS, numargs, args);
PtRealizeWidget( mywidget );

/* eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
return( Pt_CONTINUE );
}
/*****************/

I hope this helps.

Regards,
Dave B.



Andea <a.lombardi@genesy.it> wrote in message
news:alhu2n$5k8$1@inn.qnx.com

I would like to know if it is possible to create PtRaw widget at run time.
Suppose i have a window with several widget of PtRaw type all contained in
a
widget of type PtOSContainer. I want delete one of the widgets and adding
a
new one.
Is it possible ?

Bye,

Andrea