[comp.windows.x] explicit dispatching in XView

walsh@xn.ll.mit.edu (05/30/91)

These are some general questions about explicit dispatching in xview.  If
question (1) interests you then please read on, else "can" this message.


My setup:	Sun 3/60, 16 Meg
		UNIX BSD 4.3
		OpenWindows
		XView toolkit


(1)	Does anyone know of any examples of explicit dispatching using
	xview besides those examples in the xview manual?  (i.e.
	something I could pick up from a comp.sources.x archive	site?)


(2)	Also, there is an example xview program "notifier/notify.c"
	which is not in my XView Programming Manual.  Does anyone know 
	where this program came from?

	(All the example xview programs at my site are in
	 $OPENWINHOME/share/src/sun/xview/examples.  The
	 "notifier/notify.c" program came right off the tape with all
	 the other examples; but, it is not talked about in the manual.)


(3)	The "notifier/notify.c" example program uses a select call
	to check if there is something to read from the server.
	Isn't it bad to mix unix system calls (select, signal, ...)
	when using the notifier?  or is this case an exception?

	Here's an except from  "notifier/notify.c":

	...

	    /* Get the server connection number. */
	    fd = XConnectionNumber(dpy);

	...

	    while (RUN) {
	        FD_SET(fd, &readfds);

	        /* Check to see if the server has written to us. */
	        if (select(FD_SETSIZE, &readfds, NULL, NULL, &timeout)) {

	            /* Read and dispatch events from the server. */
	            notify_dispatch();

	        } else {
	            static int toggle = 0;


(4)	The example code except from the XView Programming Manual section 
	19.10.2 entitled "Explicit Dispatching" (p 399-400 in my book) 
	looks pretty simple.  My code is similar; but, the results are 
	unpredictable.  Sometimes events are caught and sometimes clicking 
	on a panel button locks up my display.

	Has anyone else had better luck with Explicit Dispatching?


(5)	Other odd behavior is when a button is clicked, it displays in 
	inverse; but, the event is not handled until the mouse exits and 
	then re-enters the frame (at which time the panel button displays 
	normal again.)


Any insight into Explicit Dispatching would be greatly appreciated.

-mike-
walsh@xn.ll.mit.edu