[comp.windows.x.motif] DialogShell & autoUnmanage

drk@twinkie.Rational.COM (David Kaelbling) (05/14/91)

My application often needs to popup a dialog from within a callback.
I then want to keep control in the callback until the dialog has been
answered.  I tried this:

      // Block until the dialog is answered.
      XtManageChild(child);
      while(XtIsManaged(child))
	{
	  XtAppNextEvent(app, &event);
	  XtDispatchEvent(&event);
	}

All is fine until the main window is iconified.  The dialog iconfies
also, and does my loop exits prematurely.  What additional test can I
add?  Obviously somebody knows the dialog is supposed to be managed,
because normalizing the main window restores the dialog too...

I suppose I can suppress autoUnmanage and add my own activate and
delete callbacks, but there must be a better way.  I'm running Motif
1.1.2 and MIT X11R4 on a Sun-4.

	Thanks,
	David
--
David Kaelbling                                       (408) 496-3600
c/o Rational; 3320 Scott Boulevard; Santa Clara, CA       95054-3197
Email: DKaelbling@Rational.COM, or uucp {uunet,ubvax,aeras}!igor!drk

nazgul@alfalfa.com (Information Junkie) (05/15/91)

> >All is fine until the main window is iconified.  The dialog iconfies
> >also, and does my loop exits prematurely.  What additional test can I
> >add?  
> 
> 	How about checking to see if the dialog is mapped?

This all strikes me as rather hacky (particularly when you consider
that not all window managers will unmap/manage the dialog).  I
would just put in callbacks to set a global which you then check
in your loop.  Better yet, I wouldn't have a loop - I'd just return
to the main event loop and do everything asynch.

						-kee

Alfalfa Software, Inc.          |       Poste:  The EMail for Unix
nazgul@alfalfa.com              |       Send Anything... Anywhere
617/646-7703 (voice/fax)        |       info@alfalfa.com

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.