This directory contains the source for the example programs described
in O'Reilly and Associates' X Toolkit Intrinsics Programming Manual
(Volume 4) (and a few not described there).  The examples for
Volume 4M are in a separate directory.

This distribution builds under Release 4 or Release 5.
Note, however, that no new R5 features are demonstrated here.
See the separate set of examples associated with the R5 Update
Volume.

All 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.

The code for the xtetris game mentioned in Chapter 8 is in the games 
portion of the contrib distribution.

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.

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

ch02:
xhello is a simple hello world program using Label widget.

xgoodbye is like hello with callback on Command widget

xfarewell is like xgoodbye but adds actions to Command instead of using
callbacks - click invokes a dialog confirming exit - Shift click
exits without the confirmation.  Also demonstrates setting and 
getting resources.

xclickcount.c and xwhichbutton.c are not described in the book.
They are very similar to xfarewell.  xwhichbutton adds an action so
that a Command widget executes one of three different actions
depending on which button is pressed (this user interface convention
is not necessarily recommended).  xclickcount resets
the label displayed in a Command widget to indicate the number of
times the Command is clicked.  xclickcount demonstrates getting
a user-supplied resource so that the program can change a label without
erasing the user-supplied part of it.

ch03:
xbox1	simple box
xbox2	simple form
xbox3	invokes dialog popup, with text entry, not using XtCallbackExclusive
xbox4	simple box using static argument lists and callback lists
xbox5	invokes dialog, without text entry, using XtCallbackExclusive (callback list with PrepareDialog)
xbox6	Uses R3Initialize utility function and explicit application contexts

Ex3-6	Example 3-6 from book:  passing a number to a callback through client_data
Ex3-7	Example 3-7 from book:  passing a structure to a callback through client_data

ch04:
xbitmap1	simplest bitmap editor, using BitmapEdit
xbitmap2	add scrollbars to xbitmap1, using BitmapEdit
xbitmap3	add small pixmaps to xbitmap1, using BitmapEdit.  Also add file reading and writing.
xbitmap4	implement xbitmap1 NOT USING BitmapEdit

xbitmap5	xbitmap1 with scrollbars implemented with Viewport
xbitmap6	xbitmap3 with small pixmaps implemented with Label
xbitmap7	both scrollbars and small pixmaps to xbitmap1, using BitmapEdit
xbitmap8	using BitmapEdit, both reads and writes standard bitmap files.

BitmapEdit.c	Source file for BitmapEdit widget, described in chapters 5 and 6.
BitmapEdiP.h	Private include file for BitmapEdit, described in Chapter 5.
BitmapEdit.h	Public include file for BitmapEdit, described in Chapter 5.
For the examples in Chapter 5 and Chapter 6, see the BitmapEdit 
widget in the Chapter 4 directory.

ch07:
xmotdbltst	Tests motion events and double clicks in the same translation table.  Works, but is erratic.
xtryaccel	Adds an XtInstallAccelerators call to xbox1.  q and p keys should invoke actions from anywhere in the application.

ch08:
xfileinput	get input from file using XtAddInput: invoke with filename command-line argument
xpipeinput	get input from pipe using XtAddInput: specify on command-line any program that prints characters to standard out.  For example: xpipeinput 'cal 10 1989'
xworkproc	uses a work procedure to create a popup widget using idle time.

ch10:
BitmapEdit.c	This version of the BitmapEdit widget implements selections.
xbitmap1.c	Link to a version of xbitmap.
xicon.c		Specifying an icon pixmap.
icon.bit	An icon bitmap file used in xicon.c.
xicon2.c	Using the Xmu converter to read an icon file.
ScrollBox	A minimal composite widget that manages only two 
                scrollbars and a main window.

ch11:
xscrollbox	a simple version of xbitmap that tests ScrollBox.

BUG: for some unknown reason, the borders in the children of
xscrollbox are modified.

ch12:
xmenu1  Spring-loaded
xmenu2  Pulldown, popped up with Command, Popup on Press.  Down on release outside.
xmenu3  Pulldown, popped up with MenuButton instead of Command, using MenuButton popup code.  Down on release outside.
xmenu4  Pulldown invoked by Command, with submenu, Using grab mode XtGrabExclusive
xmenu5  Spring-loaded with submenu, more sophisticated CheckLeftAndPopdownSubmenu, using grab mode XtGrabNonexclusive.

xmenu6  Attempt at Pulldown identical to xmenu2 except using 
XtCallbackExclusive (callbacks only - 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 
can't be made to work.  (Moral: this type of menu must use XtMenuPopup 
action or XtPopupSpringLoaded.)

xmenu7.c  using R4 SimpleMenu, MenuButton, and all three Sme gadgets.

xdialog  Test of XtCallbackExclusive callback for popping up a dialog
box.

ch13:
xbanapp displays widgets on two displays

xbantry tries to do it on two displays with two application contexts -
this can only work on parallel processing machines and only with 
system-specific additions that indicate parallelism, or if you rewrite
XtAppMainLoop.
