[comp.windows.x] WorkProcess under ISC

dvb@emisle.emisle (David Van Beveren) (02/05/91)

I am running Interactive unix 2.0.2, with TCP/IP 1.1.2 and X-windows 1.2.

A program that compiled under X11R4, and ran fine compiles under ISC's
X11R3, but will not run correctly. Specifically, I have a work process,
which is registered with the call XtAppAddWorkProc( app_context, proc, NULL).

Under a system built with the MIT X11R4 tape, on a sparcstation, this works
fine, with the work process being called regularly when there are no X-events
pending. However, under ISC's X, the work process gets called once only.

Specifically, this is the code:

.
.
.
main(argc, argv) int argc; char **argv;

{
XEvent		event;

	/* initialize the socket interface */
	conn_obj = initialize_socket();
	NPGetSocket( conn_obj, &sock); /* This is proprietary stuff... */

	/* perform windows startup stuff */
	initialize_windows(argc, argv); /* Open display, etc... */

	/* Add the server background process */
	XtAppAddWorkProc( ac, server_work_proc, NULL);

	/* do the X loop */
	for(;;) {
		XtAppNextEvent(ac, &event);
		XtDispatchEvent(&event);
		}

}

XtWorkProc server_work_proc() {
/* This process is run as a work process in the background of the X loop. */

printf("In process\n");
}
.
.
.

What is wrong??
-- 
David Van Beveren                           INTERNET: emisle!dvb@ism.isc.com
EIS ltd. Professional Software Services     UUCP:   ..uunet!emisle!dvb
voice: (818) 587-1247

pete@iris49.UUCP (Pete Ware) (02/07/91)

Your workproc, server_work_proc() needs to return a Boolean value to
indicate if it is done.  Your's doesn't return anything.  From the
description in the manual:
	"This procedure should return True when it is done to indicate
	 that it should be removed.  If the preocedure returns False,
	 it will remain registered and will be called again when the
	 application is next idle."

--pete
Pete Ware / Biosym / San Diego CA / (619) 546-5532
uucp:	  scripps.edu!bioc1!pete
Internet: bioc1!pete@scripps.edu