@begin(header)
author: ackerman=ag@.ics.uci.edu
show_author: ShowNone
author_organization: Harvard X Class
node_expert: ackerman=ag@ics.uci.edu 
expiration_date: 11/07/93
last_modifier: ackerman=ag@ics.uci.edu
last_mod_date: 07/21/93
mod_num: 6
@end(header)
-----------------------
What is a Shell widget?
-----------------------

Outline of this node
 1. When you get a shell
 2. Why shells exist
 3. Special "features" of shells
 

@begin(1)
When you get a shell
--------------------

When you do an XtInitialize or XtAppInitialize, the routine returns a widget id. 
This widget id is the id of the shell widget for your application.  You can
create additional shell widgets (ie, shells that can be moved independently by
the user through the window manager) by doing an XtAppCreateShell call.
@end(1)

@begin(2)
Why shells exist
----------------

The window for the shell widget is a child of the RootWindow for the screen.
Thus, the shell widget is the only widget that needs to contain code for
dealing with the interaction with the window manager.

Thus you do not need to set any WMProperties in your application; the shell's
code does that for you.  Shells contain code to deal with the interaction between
your application and the window manager as specified by the Inter-Client
Communication Conventions Manual (ICCCM).The code that is required is fairly
ugly, and you really don't want to do it yourself.  Use a toolkit.
@end(2)

@begin(3)
Special "features" of shells
-----------------------------

There are several small gotchas with shells.

First, a shell widget is a composite, but it can contain only *one* child.
Therefore if you want multiple children (as almost every application does),
you must nest some intermediate composite.  For example, say you wanted
an application with 4 buttons:

		shell
		  |
		  |
		 form
		  |
	---------------------------
        |          |       |      |
	button1 button2 button3 button4

The widget (instance) tree would be the shell widget as the root of your
application. You must use a form widget (or any other composite widget) as an
intermediate composite.

Second, you will need to set the XtNinput (or XmNinput if you are using
Motif) resource to True if you want the shell and any children to accept
user input.   

Third, you must set the XtNallowShellResize (or XmNallowShellResize) resource to
be True if you want your application to be resizable by program actions.
That is if you have some text or form or any other widget that may grow in
size, and you would like your application to grow to fit it, you must
set this resource.
@end(3)
