This directory contains the source for the example programs described
in O'Reilly and Associates' X Toolkit Intrinsics Programming Manual,
Motif Edition (and a few not described there).  These examples require
Motif 1.2 and the X11R5 version of Xt and the other X libraries.

Most of the files in the top level directory are application defaults 
files for the examples in the subdirectories.  To run the programs using
the application defaults files (in many cases necessary for the programs
to operate properly), simply set the XAPPLRESDIR environment variable
to point to this directory (or install these files in 
/usr/lib/X11/app-defaults).  Note that the value of XAPPLRESDIR must 
end in a /.

The example code is in subdirectories named after the chapter where
the examples are described.

If you are getting this archive from UUNET, the source for the 
xtetris game is in the xtetris subdirectory.  If you are getting
this archive from the X11 source tape from MIT, then the source for 
xtetris is in the directory contrib/games/xtetris.

Note that the Makefiles do not install the example
programs.  The examples are intended to be run from this directory so 
that they don't clutter up /usr/bin/X11/ because they are not generally
useful as real programs (with the possible exception of xtetris).

The following lists what is demonstrated in each of the directories.

ch02 contains the following example programs:

xhello:		a simple hello world program using the Label widget

xgoodbye:	xhello with a callback on a PushButton widget

xsetstring: 	demonstrates how to use XtVaSetValues and how to set
		a compound string in the code.

xgetstring: 	demonstrates how to use XtVaGetValues and how to get a 
		compound string in the code.


ch03 contains the following example programs:

xrowcolumn:	a simple XmRowColumn containing PushButtons

xform:		a simple XmForm containing PushButtons

xmainwindow:	an XmMainWindow, with a menu bar, a File menu containing 
		quit, and a Help menu containing a help button that posts 
		a dialog -- both menus have tear-off behavior enabled

Ex3-8:		example 3-8 from book -- passing a number to a callback 
		through client_data

Ex3-9:		example 3-9 from book -- passing a structure to a callback 
		through client_data


ch04 contains the following example programs:

xbitmap1:	simplest bitmap editor, using BitmapEdit widget

xbitmap2:	add small pixmaps to xbitmap1, using XmDrawingArea

xbitmap3:	add small pixmaps to xbitmap1, using XmPrimitive

xbitmap4:	implement xbitmap1, not using BitmapEdit widget

xbitmap5:	both reads and writes standard bitmap files, using BitmapEdit

BitmapEdit.c:	source file for BitmapEdit widget, described in chapters 
		6 and 7

BitmapEdiP.h:	private include file for BitmapEdit, described in Chapter 6

BitmapEdit.h:	public include file for BitmapEdit, described in Chapter 6


ch05 contains the following example programs:

xcomstring:	demonstrates creating compound string segments and
		modifying fonts in the middle of a compound string 

xuildemo:	a hello, world program written using uil


ch08 contains the following examples programs:

xmotdbltst:	tests motion events and double clicks in the same 
   		translation table to show that this is erratic

xtryaccel:	adds accelerators to xbox1 so that 'q' and 'p' 
   		invoke actions from anywhere in the application -- note that
   		this example uses the Athena widgets because it does not 
		work in Motif because Motif modifies translation and 
   		accelerator tables internally


ch09 contains the following example programs:

xfileinput:	gets input from file using XtAppAddInput; invoke with 
		filename command-line argument

xpipeinput:	gets input from pipe using XtAppAddInput; specify on 
		command-line any program that prints characters to standard 
		out (xpipeinput "cal 10 1989")

xstdin:		gets input from pipe from stdin

xworkproc:	uses a work procedure to create a popup widget using 
		idle time


ch10 contains the following example programs:

xpixmap.c:	invokes a resource converter from the application;
		since the Motif converter CvtStringToPixmap is not 
		application accessible, the program uses the Xmu
		StringToBitmap converter

xfallback.c:	defines a set of fallback resources


ch11 contains the following example programs: 

xicon:		an example of specifying an icon pixmap

xselectbit:	a simple version of xbitmap the provides selection
		capabilities

BitmapEdit.c:	source file for a version of the BitmapEdit widget 
		the implements selections 
		(uses XmuConvertStandardSelection from the Xmu library)

BitmapEdiP.h:   private include file for BitmapEdit

BitmapEdit.h:   public include file for BitmapEdit

icon.bit:	an icon bitmap file used in xicon.c.


ch12 contains the following example programs:

xscrollbox:	a simple version of xbitmap that tests ScrollBox

ScrollBox.c:	source file for a minimal composite widget that manages 
		two scrollbars and a main window

ScrollBox.h:	public include file for ScrollBox

ScrollBoxP.h:	private include file for ScrollBox


ch13 contains the following example programs:

xpopup:		a basic Motif popup menu without accelerators or mnemonics

xpopupcasc:	a Motif popup menu with a cascading submenu

xmenu1:		a simple spring-loaded popup menu using the Athena widgets

xmenu2:		a simple pulldown menu from an Athena command widget

xmenu3:		a simple pulldown menu using the Athena MenuButton widget

xmenu4:		a pulldown menu with a submenu, using the Athena widgets

xmenu5:		a spring-loaded popup menu with a submenu, using the
		Athena widgets

xmenu6:		an attempt at a pulldown menu identical to xmenu2 except 
		using XtCallbackExclusive with callbacks only and no 
		actions -- doesn't work because XtCallbackExclusive calls 
		XtPopup which can't pass the right parameters to _XtPopup
 		(even if you write your own callback it still won't work --
		this type of menu must use the XtMenuPopup action)  -- 
		fixed by XtPopupSpringLoaded

xmenu7:		a pulldown menu using the Athena SimpleMenu, MenuButton, 
		and all three Sme gadgets

xdialog:	a dialog box using the Athena widgets that is popped up
		with XtCallbackExclusive callback


ch14 contains the following example programs:

xtwodisp:	an application with windows on two displays

xtwoapp:	an application that uses two application contexts and
		two displays


