Dorrie Hall (dorrie++at++beamish.mit.edu)
Wed, 18 Oct 1995 12:21:28 -0400
> In our application, we suspend portions of our cull and draw
>processing depending on the state of a global flag. e.g.,
..
>THE QUESTION:
>With respect to setting the state of our global flag,
>in an application which uses pfuGLXWinopen (), is there a preferred
>method to test whether the top level window has been iconified or not?
>A code snippet would be appreciated.
Hi Rob, This not pfuGLX nor is it likely to be the preferred method.
It is however a code snippet.
Dorrie
main loop stuff
**
XtAppPeekEvent(app_context,&pevent);
if((mask = XtAppPending(app_context)) != NULL){
if(pevent.type == UnmapNotify){
undomap(&pevent);
}
else if(pevent.type == MapNotify){
domap(&pevent);
}
XtAppProcessEvent(app_context,mask);
}
if((mask = XtAppPending(text_app))!= NULL ){
XtAppProcessEvent(text_app,mask);
}
**
/*************************************************************************/
/* void undomap(XEvent *pevent) */
/*************************************************************************/
void undomap(XEvent *pevent){
/* this is called when a graphics window is iconified,
a flag is set so the window is not updated while
it is iconified */
int i,s;
/* find which window */
for(s =0; s < allspectros.count; s++){
for(i=0; i < 4; i++){
if(pevent->xunmap.window ==
XtWindow(allspectros.list[s]->toplevel[i]) ){
allspectros.list[s]->normstate[i] = 0;
/* get out of here */
i = 4; s = allspectros.count;
}
}
}
}/* end undomap */
/*************************************************************************/
/* void domap(XEvent *pevent) */
/*************************************************************************/
void domap(XEvent *pevent){
/* this is called when window is normalized
after being an icon, the window is updated and a flag is
set so other updates are processed
*/
int i,s;
/* find which window */
for(s =0; s < allspectros.count; s++){
for(i=0; i < 4; i++){
if(pevent->xmap.window ==
XtWindow(allspectros.list[s]->toplevel[i]) ){
if(allspectros.list[s]->normstate[i] != 1){
if( i == SPECTRUM)
allspectros.list[s]->history = 0;
allspectros.list[s]->normstate[i] = 1;
update(allspectros.list[s]->info[i],
allspectros.list[s], i);
}
/* get out of here */
i = 4; s = allspectros.count;
}
}
}
}/* end domap*/
/*******************************/
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:57 PDT