[comp.windows.x.motif] Problem placing several main windows in one application

dvb@emisle.emisle (David Van Beveren) (05/14/91)

OS: Ultrix 4.1
Platform: DECstation 3100
X11R4, Patch18, Motif 1.1 from sources

   I am involved in developing an application that reads a file at run-time
   to build a screen. The file contains resources like x, y, width, height
   for a main window any children. All of the corresponding widgets are
   created, managed and finally the top level widget is realized. 

   The highest object available to the user is the 'Form' (not to be confused
   with the Motif Form). This object is implemented as a topLevel shell over
   a MainWindow with a bulletinBoard as its WorkWindow. (work area?). The file
   read specifies X and Y for the form. The user can open many forms, all of
   which are implemented as children of one application shell:


   app = XtInitialize( .. .. ..);
   
   topLevel = XtAppCreateShell( .. .. topLevelShellWidgetClass, .. ..);

   main = XmCreateMainWindow( toplevel, .. .. ..);

   form = XmCreateBulletinBoard( main, .. .. ..);

   where app is created once, and the others are created for every form.


   The problem is that mwm will NOT allow me to place the toplevel (main window)
   I have tried setting the x and y resources in the toplevel and/ or in the
   main. I have tried setting the XmNgeometry resource in the topLevel and/or
   the main. Mwm 'stacks' the windows. Every time I run a program that opens one
   window, it is located a little lower and to the right of the previous, until
   I run out of screen when it starts over again in  the upper left. If I run
   the program several copies simultaneously, They stack very nicely, so I can
   see all of the title bars and the left edge of the mem border.

   This heirarchy seems wrong to me. What I want is the following (I think:)

                    Application Shell
                     /     |     \
                    /      |      \
               topLevel  topLevel  topLevel
                  |        |          |
                main      main       main
                  |        |          |
                 BB        BB         BB

   If not, what do I need to do to place the main windows where they should go?
   It really should be done before the tree is realized, (XtRealize(topLevel)),
   so things don't move once they have appeared. Obvoiusly the WM is taking
   control of the situation. What should be done? Any help, e-mail or posted
   will be appreciated. Code samples will be admired.

Thanks

-- 
David Van Beveren                           INTERNET: emisle!dvb@ism.isc.com
EIS ltd. Professional Software Services     UUCP:   ..uunet!emisle!dvb
voice: (818) 587-1247

bill@polygen.uucp (Bill Poitras) (05/21/91)

Have you tryed setting 'mwm*clientAutotPlace: False' ?

+-----------------+---------------------------+-----------------------------+
| Bill Poitras    | Polygen Corporation       | {princeton mit-eddie        |
|     (bill)      | Waltham, MA USA           |  bu sunne}!polygen!bill     |
|                 | FAX (617)890-8694         | bill@polygen.com            |
+-----------------+---------------------------+-----------------------------+