This distribution contains the source for the example programs in the Motif
Programmer's Manual, Volume 6A in O'Reilly & Associates' series on the X 
Window System.  The programs are written by Dan Heller, Paula Ferguson,
and Dave Brennan (where indicated), Copyright 1994 O'Reilly & Associates and
Z-Code Software (where indicated).  The programs are not in the
public domain, but they are freely distributable without licensing
fees.  These programs are provided without guarantee or warrantee
expressed or implied.

These examples require Motif 1.2.  They have been compiled using the X11R6
versions of the Xt and X libraries.  


Distribution Contents
---------------------

The examples are in subdirectories named after the chapters in 
the book where the examples are described.  The book is not required to
use or build the example programs, although the corresponding
chapters do add quite a bit of explanation about what's going on.

The top-level directory of this distribution contains this README file,
an Imakefile, the example program subdirectories, and an app-defaults
subdirectory.  Most of the examples in this distribution have the same
application class for purposes of the application defaults file.  The 
class name is "Demos", so the defaults file is named "Demos".  This file, 
as well as a few other application defaults files for selected examples, 
are provided in the app-defaults directory.  To run the programs using
these defaults files, simple set the XAPPLRESDIR environment variable to
point to the app-defaults directory (or install the files in 
/usr/lib/X11/app-defaults).

The example program subdirectories each contain an Imakefile and a
Makefile.raw file for building the programs, as described shortly.
The subdirectories contain the following programs:

ch02: hello.c

ch04: cmd_area.c dynapix.c main_list.c msg_area.c show_pix.c

ch05: ask_user.c ask_user_simple.c dialog.c hello_dialog.c modal.c
      reason.c warning.c 

ch06: file_sel.c prompt_dlg.c select_dlg.c show_files.c

ch07: action_area.c action_area2.c help_text.c map_dlg.c modify_btn.c 
      question.c

ch08: attach.c corners.c entry_cb.c form_corners.c frame.c paned_win1.c
      paned_win2.c proc_traversal.c rowcol.c spreadsheet.c text_entry.c
      text_form.c tictactoe.c traversal.c unit_types.c

ch09: app_scroll.c getusers.c monitor_sb.c simple_sb.c traversal.c

ch10: color_draw.c draw2.c drawing.c free_hand.c

ch11: arrow.c arrow_timer.c drawn.c multi_click.c pixmaps.c pushb.c
      radio_box.c simple_radio.c toggle.c toggle_box.c xcal.c

ch12: alpha_list.c browse.c extended.c multiple.c scrolled_list.c
      search_list.c simple_list.c

ch13: color_slide.c simple_scale.c tick_marks.c

ch14: allcaps.c cut_paste.c editor.c error_test.c file_browser.c 
      modify_text.c password.c prompt_phone.c prompt_phone2.c replace.c
      search_text.c select_text.c simple_text.c text_box.c

ch15: build_menu.c build_option.c file_menu.c file_menu2.c popups.c
      simple_option.c simple_popup.c simple_pullright.c

ch16: icon_pixmap.c icon_window.c resize_shell.c set_minimum.c wm_delete.c
      wm_protocol.c

ch17: copy_by_name.c copy_retrieve.c incr_retrieve.c inquire.c
      query_retrieve.c undo.c

ch18: editor_dnd.c editor_help.c file_manager.c file_manager2.c

ch19: fontlist.c multi_font.c string.c

ch20: app_box.c

ch21: busy.c more_help.c simple_help.c warn_msg.c working.c

ch22: hello_world.c hello_world.uil

ch24: bomb.uil cb.uil first.uil globe.uil joel.uil joel_bug.uil
      kids.uil multiline.uil resource.uil second.uil showuid.c
      simple_lst.uil station.uil trivial.uil

ch25: dialogs.uil editor.uil editor_uil.c identifiers.uih menubar.uil
      procedures.uih

ch26: XawPanner.uih XawTree.uih btn_panel.uih dialog.uil i18n_dialog.uil 
      procedures.uih quitbox.uil quitdialog.uil quitmain.uil showuid.c
      showuid2.c strings.uih strings.uil three_btn.uih tree.c tree.uil

appendix: xmemo.c xshowbitmap.c zcard.c


Compiling the Programs
----------------------

This distribution is designed to build under Motif 1.2 and X11R6.

We were not able to get the Imakefiles to work with our configuration
of Motif 1.2 and X11R6 -- your mileage may vary.  If you can get them
to work, then the easiest way to build the programs is to use
imake, a program supplied with the X11 distribution that
generates proper Makefiles on a wide variety of systems. imake
uses configuration files called Imakefiles that are included with the
examples.  If you have imake, you should type the following in
the top-level directory that contains the examples:

% xmkmf
% make Makefiles
% make

If you have any problems building Makefiles using imake, you can try
using the Makefile.raw files in each directory.  These files are
currently set up to use a Motif installation in /usr/Motif12 and an
X11R6 installation in /usr/X11R6.  If you have install Motif and X in
other places, you will need to modify the Makefile.raw files.  Once you
have done that, you should be able to type:

% make -f Makefile.raw

in each subdirectory to make the programs.  If you have a standard compiler
(or you at least know your way around the quirks in your compiler),
you shouldn't have a problem with this method.  However, this may not be
enough for all compilers as some require additional options,
include and library path specifications, dependencies, etc.

If all else fails, you can try to build each file manually using the 
simple command:

% cc filename.c -o filename -lXm -lXt -lSM -lICE -lX11

A few of the examples use regular expression functions that do pattern-
matching on strings.  For these programs, some SYSV machines may have
to add the -lPW library to the LOCAL_LIBRARIES part of the Imakefiles
or the LIBS directive for all Makefile.raw files.



