[comp.windows.x] Motif FormDialog problems

arne@yc.estec.nl (Arne Lundberg) (02/13/90)

I am using HP OSF/Motif on a HP 9000/800 system. I have a few problems:

1) I want to create a modal FormDialog that pops up and
   disables the main application until it is closed down.
   I have tried using the XmCreateFormDialog() function and this
   creates a modeless dialog? Is there any way in Motif to do this?

2) The manual specifies that this FormDialog should always be iconified
   together with the toplevel window. This does not work when using R4
   twm but (of course) when I use the Motif windowmanager mwm.
   Why is this so? Does Motif require more than a ICCCM compatible
   windowmanager?


Arne Lundberg

European Space Technology Centre, Noordwijk, the Netherlands
arne@yc.estec.nl or ALUNDBER@ESTEC.BITNET
Phone: +31 1719 84865, Fax: +31 1719 12142, Telex: 39098

gabe@hpcvlx.cv.hp.com (Gabe Begeddov) (02/14/90)

   / hpcvlx:comp.windows.x / arne@yc.estec.nl (Arne Lundberg) /  6:12 am  Feb 13, 1990 /
   
   I am using HP OSF/Motif on a HP 9000/800 system. I have a few problems:
   
   1) I want to create a modal FormDialog that pops up and
      disables the main application until it is closed down.
      I have tried using the XmCreateFormDialog() function and this
      creates a modeless dialog? Is there any way in Motif to do this?

one of the consequences of following the PM model in Motif 1.0 was that we
did not support what will be called XmFULL_APPLICATION_MODAL in Motif 1.1. This is the
mode that locks out user input for all other windows of the application 
for that display. Instead we supported the PM style that only locks out 
ancestors in the transient tree of the dialog. What this means is that if you take your
widget tree and prune it leaving only shells and think of each non-transient
shell as the root of a "transient" tree then these are the trees that Mwm (and
PM) will maintain stacking order, modal input and iconification on. 

When using Mwm, you can set the Dialog's XmNdialogStyle resource to 
XmDIALOG_APPLICATION_MODAL or XMDIALOG_SYSTEM_MODAL and get something close to
what you want. If you're determined to lock out in the Xt style then you can
explicitly use the Xt calls XtGrab(form, XtGrabExclusive) and XtUngrab(form)
before calling XtManageChild and XtUnmanageChild respectively. This will
be directly supported in Motif 1.1 which will be available summerish.
   
   2) The manual specifies that this FormDialog should always be iconified
      together with the toplevel window. This does not work when using R4
      twm but (of course) when I use the Motif windowmanager mwm.
      Why is this so? Does Motif require more than a ICCCM compatible
      windowmanager?

Mwm uses the transient tree (which is determined by the WM_TRANSIENT_FOR property
on the shell) to manage iconification. Other window managers may use the 
window_group field of the WM_NORMAL_HINTS to manage iconification. One problem
with the setting of these properties is that they are set when the shell is
realized. If the other shell that you want to be associated with is not
yet realized your window_group field will be set to NULL. Motif handles this
by updating the WM_TRANSIENT_FOR property when the associated window is
finally realized. The window_group code in Shell doesn't do this. If your
realization order is such that you create the FormDialog before you realize
your applicationShell then this may be your problem. This is due to the
fact that FormDialog realizes it's shell parent during it's create logic.
You can either change the create/realize order or explicitly setValue the
XmNwindowGroup field of XtParent(form) to XtWindow(topShell).
   
   Arne Lundberg
   
   European Space Technology Centre, Noordwijk, the Netherlands
   arne@yc.estec.nl or ALUNDBER@ESTEC.BITNET
   Phone: +31 1719 84865, Fax: +31 1719 12142, Telex: 39098
   ----------

Gabe Beged-Dov   
Interface Technology Operation   
Hewlett-Packard (Corvallis, Or)