[comp.windows.x] help getting message displayed

slm@cs.arizona.edu (Sandy Miller) (04/25/91)

I have the following routine, which I use to display error and processing
messages to the screen.  It works fine for the error messages, since they
are displayed when processing is stopped (return from action or callback
routine).  But when I try to use it to display processing information
(i.e. "Generating graphic display; please wait"), the message is not
displayed.  Interestingly, the window is configured, popped up, and the
bell rings, but there is no message in the window until the processing
completes (not very helpful).  I tried faking an expose event and
processing this event by hand (by calling XtDispatchEvent) but nothing
changed.  Anybody have any helpful hints?

void put_message(message)
char *message;
{
   int width;

   width = strlen(message) * 6 + 20;
   Msg_args[0].value = (XtArgVal)message;
   Msg_args[1].value = 20;
   Msg_args[2].value = width;
   XtSetValues(Msg_win.label, Msg_args, 3);
   XtConfigureWidget(Msg_win.shell, Screen_width - width - 10,
		     Screen_height - 30, width, 20, 1);
   XtPopup(Msg_win.shell, XtGrabNone);
   XBell(Dspl, 0);
   XFlush(Dspl);

}  /* end put_message */

Oh, yes, Msg_win.label is a managed label widget within Msg_win.shell,
which is a popup shell widget.

Thanks a bunch!

-sandy