Path: utzoo!utgpu!watserv1!watmath!att!att!linac!uwm.edu!zaphod.mps.ohio-state.edu!usc!jarthur!uunet!bywater!arnor!larios!db3l From: db3l@ibm.com (David Bolen) Newsgroups: comp.windows.x.motif Subject: Re: Help for modal windows needed Message-ID: Date: 31 Oct 90 21:12:48 GMT References: <1990Oct30.182737.1219@applga.aa.cad.slb.com> Sender: news@arnor.uucp (NNTP News Poster) Organization: Laboratory Automation, IBM Thomas J. Watson Research Center Lines: 48 In-Reply-To: harper@applga.aa.cad.slb.com's message of 30 Oct 90 18:27:37 GMT In article <1990Oct30.182737.1219@applga.aa.cad.slb.com> harper@applga.aa.cad.slb.com (Brett E. Harper) writes: > Does anyone know of a good way to acheive modal input focus under motif? >What I want is when a modal dialog box comes up, that it should lock out input >to any other windows within the application. I'm not sure it's the best solution, but what I ended up doing to accomplish this myself was to turn off the sensitivity of the windows affected by the modal dialog box, via XtSetSensitive(widget,False). For my case, I just issued this on the shell widget that was the top level of my tree, which also blocked any children. And if you have a menu on the window, it adjusts to show that it is now insensitive, so the window at least shows some indication of being locked. When the dialog goes away, just reenable the sensitivity. > This does not help me any I would like to see lock out on every window within >the application. Suppose I had a hierarchry like this: > TopLevel > | | > InfoWindow MainWindow > | |...| > P1 P2 Pn >where, Px is a DialogShell that can either be modeless or modal. >note, only one modal DialogShell will be on screen at any one time. >Say P1 is modal, then I would like to lock out input to P2,...,Pn,InfoWindow, >and MainWindow until P1 is undisplayed. I'd try the XtSetSensitive on your TopLevel. Of course, you'll have to make sure that your popup that is modal is not a child of the window you are disabling the sensitivity of, but since most popups have their own transient shell, that shouldn't be too hard to set up. Of course, if the modeless dialogs also have their own transient shell that is not a child of TopLevel (or InfoWindow), you'll have to disable them explicitly in addition to TopLevel. -- David -- /-----------------------------------------------------------------------\ \ David Bolen / | Laboratory Automation, IBM Thomas J. Watson Research Center | / P.O. Box 218, Yorktown Heights, NY 10598 \ | - - - - - - - - - - - - M i t h r a n d i r - - - - - - - - - - - - | | Internet : db3l@ibm.com | Bitnet : db3l@yktvmv | | Usenet : uunet!bywater!arnor!larios!db3l | Phone : (914) 945-1940 | \-----------------------------------------------------------------------/