[comp.windows.x] Per Display Information

tad@cathedral.cerc.wvu.wvnet.edu (Tad Alan Davis) (10/04/90)

I am trying to get a widget to update while in a callback, I was
using the following on sun3,

void     updateWidget(w)

   Widget     w;

   {
   int        count = 0;
   XEvent     event;
   Display    *disp;

   while ((count < 5000) &&
      !XCheckTypedWindowEvent(XtDisplay(w), XtWindow(w), Expose, &event))
      {
      count++;
      }
   XtDispatchEvent(&event);
   disp = XtDisplay(w);
   XFlush(disp);
   }


but when I moved to sun4, I would get

Error: Couldn't find per display information

Noticing that event.type was 0 in these cases, I just decided not
to update, so I added an if.

void     updateWidget(w)

   Widget     w;

   {
   int        count = 0;
   XEvent     event;
   Display    *disp;

   while ((count < 5000) &&
      !XCheckTypedWindowEvent(XtDisplay(w), XtWindow(w), Expose, &event))
      {
      count++;
      }
   if (event.type)
      {
      XtDispatchEvent(&event);
      disp = XtDisplay(w);
      XFlush(disp);
      }
   }

This seems to work if I'm only trying to update 1-5 widgets while in
the callback, once I get up to 10 widgets, I get the same error, with
event.type = 12 this time.

The context is a set of gauges which need to be updated throughout the
course of a simulation run.  Any fixes or ideas on how this can be
approached in a more sound way?

--
					Tad Davis
					Bell Atlantic Knowledge Systems