Previous Next Up Title Contents Index Top Library

7.8. USING WIDGET WITH PHIGURE

For using PHIGURE with the GPHIGS Widget you must use XmNcreateDACallback as follow :

void openPhigure_CB(w,client,call)
  Widget w;
  XtPointer client, call;
{
	topen_ws ( 1, PDEF_ERR_FILE, 8887);
}
main () 
{

  toplevel = XtInitialize ("Test", "Test", NULL, 0, &ac, NULL);

  topen_phigure(PDEF_ERR_FILE);
  n = 0;
  XtSetArg(args[n], XmNresizeWs, XmGPHIGS_RESIZE_WS); n++;
  gphigs = XtCreateManagedWidget("GPHIGS",xmGPhigsWidgetClass,toplevel,args,n);
  XtAddCallback(gphigs, XmNcreateDACallback, openPhigure_CB, NULL);

  XtRealizeWidget  (toplevel);
  XtMainLoop();
}

NOTE: In this case, the resize callback must include the computation of the PHIGURE view as follows:

  
void resize_CB w,c,call)
Widget w;
XtPointer c,call;
{
tupd_ws(WKID,PPOST_PONE);
tview_center2(WKID,1,&pointC,zoom,&viewport);
predraw_all_structs(WKID,PFLAG_ALWAYS);
}


Previous Next Up Title Contents Index Top Library