[comp.windows.x.motif] Modal Dialog widget: assistance requested

woodruff@addvax.llnl.gov (Woodruff, John P) (01/24/91)

OSF Prog Guide 5.1 states "a single-reply Dialog widget is modal in nature.
This means that a reply is required before the application can continue."

My goal: in a program where there are multiple application shells created
by XtAppCreateShell, I want to pop up a dialog in one of these which
demands user response (locking out other buttons until the modal dialog
is satisfied) without affecting the other App Shells.

So I try to create such a widget:
  XtSetArg (args[n], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL);  n++;
  modal = XmCreateMessageDialog (parent, "ShouldBeModal", args, n);

Let there be some button whose callback is
  void modalup (w, d, call_data)
{ XtManageChild(d); }

Now when that button is pressed,the message dialog pops up nice as can be,
BUT it is NOT modal:  every other button in its App Shell (and the other
App Shells as well) continue to perform just as when the "modal" dialog
is absent.  

Please help me understand how to make "ShouldBeModal" behave.  I am unsure
how to find whether the proper widget got the intended resource value
binding.  I'll be grateful for help.

John Woodruff
Lawrence Livermore National Lab

cathy@cged.co.uk (Cathy Evans) (01/31/91)

woodruff@addvax.llnl.gov (Woodruff, John P) writes:

>My goal: in a program where there are multiple application shells created
>by XtAppCreateShell, I want to pop up a dialog in one of these which
>demands user response (locking out other buttons until the modal dialog
>is satisfied) without affecting the other App Shells.

>So I try to create such a widget:
>  XtSetArg (args[n], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL);  n++;
>  modal = XmCreateMessageDialog (parent, "ShouldBeModal", args, n);

I don't know which version of Motif you're using, but in version 1.1,
there is a value XmDIALOG_FULL_APPLICATION_MODAL.  I've just tried
this and it seems to do the trick - ie halts the application until the
message box is responded to.


Cathy Evans	Computer General ED, The New Church, Henry St, BATH BA1 1JR, UK
		Tel: +44 225 482744 	Fax: +44 225 442751
		cathy@cged.co.uk