[comp.windows.x.motif] toplevel shells

tsang@isi.com (Kam C. Tsang) (07/26/90)

I have multiple toplevel shells within a single application created
using XtCreateApplicationShell.  My problem is in indentifying the
resources of these toplevel windows in the .Xdefaults file.  This
means that I can't change the geometry of the toplevel shells using
the .Xdefaults file.  The shells were created using something like

shellA = XtCreateApplicationShell("ShellA", topLevelShellWidgetClass,
                                   NULL, 0);

shellB = XtCreateApplicationShell("ShellB", topLevelShellWidgetClass,
                                   NULL, 0);

and the intention was to be able to specify in the .Xdefaults file
something like:

program*ShellA*geometry:300x521+1+1
program*ShellB*geometry:617x521+113+90
program*ShellA*title: window A
program*ShellB*title: window B

Any help in solving this one will be appreciated.

     --------------------------------------------------------------
     Kam Tsang                           User Interface Group             
     Tel:        (408) 980-1500 x275     Integrated Systems, Inc.         
     Internet:   tsang@isi.com           2500 Mission College Blvd.       
     Voice mail: (408) 980-1590 x275     Santa Clara, CA 94054            

heap@bmc.uu.se (07/30/90)

In article <9007260058.AA06148@canopus>, tsang@isi.com (Kam C. Tsang) writes:
> I have multiple toplevel shells within a single application created
> using XtCreateApplicationShell.  My problem is in indentifying the
> resources of these toplevel windows in the .Xdefaults file.  This
> means that I can't change the geometry of the toplevel shells using
> the .Xdefaults file.  The shells were created using something like
> 
> shellA = XtCreateApplicationShell("ShellA", topLevelShellWidgetClass,
>                                    NULL, 0);
> 
> shellB = XtCreateApplicationShell("ShellB", topLevelShellWidgetClass,
>                                    NULL, 0);
> 
> and the intention was to be able to specify in the .Xdefaults file
> something like:
> 
> program*ShellA*geometry:300x521+1+1
> program*ShellB*geometry:617x521+113+90
> program*ShellA*title: window A
> program*ShellB*title: window B
> 
> Any help in solving this one will be appreciated.
> 
>      --------------------------------------------------------------
>      Kam Tsang                           User Interface Group             
>      Tel:        (408) 980-1500 x275     Integrated Systems, Inc.         
>      Internet:   tsang@isi.com           2500 Mission College Blvd.       
>      Voice mail: (408) 980-1590 x275     Santa Clara, CA 94054            

I had the same problem. My solution was to create an unmanaged toplevel
widget of class applicationShellWidgetClass with XtAppCreateShell().
After this I create my real toplevel windows as children of this unmanaged 
toplevel widget. The children are of the same class as the parent and are
created with the function XtCreatePopupShell().
With this method I can refer to the toplevel windows in the same way as
you describe above.
I got the idea from HP:s Xt programming manual.
Good luck !
-- 
----------------------------------------------------------------------
Per Bengtsson, Dept. of Scientific Computing, Univ. of Uppsala, Sweden

Internet:       heap@tdb.uu.se
Sunet/Decnet:   tdb::heap
----------------------------------------------------------------------