Path: utzoo!attcan!uunet!husc6!bloom-beacon!WHEATIES.AI.MIT.EDU!sundar
From: sundar@WHEATIES.AI.MIT.EDU (Sundar Narasimhan)
Newsgroups: comp.windows.x
Subject: question about widget visibility
Message-ID: <8807041447.AA00568@special-k.ai.mit.edu>
Date: 4 Jul 88 14:47:21 GMT
Sender: daemon@bloom-beacon.MIT.EDU
Organization: The Internet
Lines: 33

I have an application that creates a few widgets and draws on them.
I am using the athena widget set -- forms, command butttons etc..
Input to the application comes from stdin. When I wrote the code to
read and write to the widgets, I noticed that the first few display
commands never appeared on the screen. All the display commands were
those commands written to the widget between the time the toplevel
window is rubberbanded and the user uses his mouse to position the
window on the screen. I used XFlush()'s just after every display
command to no avail.

So I say to myself, my application needs to wait until it is sure that
the display window is actually visible before it can draw on it; 
I tried setting
    XtSetMappedWhenManaged(top, TRUE);
first and then
    XtSetMappedWhenManaged(top, FALSE);
and made explicit calls to XtMapWidget. I added XFlush()'s after this
and still the widgets (windows) do NOT become visible on the screen.

I then notice this thing called the VisibilityNotify event. 
So I try adding an event handler like the one shown below assuming
that the default corepart would have visible_interest set to TRUE;
    XtAddEventHandler(top, VisibilityNotify, 0, visibility, 0);

I guess wrong again. Since my handler is never being invoked obviously
the default is for visible_interest to be set to FALSE. I can't seem to be
able to set this variable. (#including CoreP.h in my program
gives all sorts of name clashes, but that is entirely another matter).

So, folks, what is the recommended way of finding out when your widget
is visible?

-Sundar