[net.sources.mac] New version of SimpleTools

info-mac@uw-beaver (10/02/85)

From: erik@ucbssl.CC.Berkeley.EDU (Erik Kilk)

!rSimpleTalk.text

Here is an updated version of SimpleTools.  Included are the SimpleTools
sources, a MacWrite document, and an example using some of the easy and
advanced features in the SimpleTools library.

SimpleTools is a set of subroutines which greatly ease the use of the
Macintosh toolbox.  It is mainly intended to be used for your smaller
applications where you would rather not be too concerned with reading
Inside Macintosh over again.  The subroutines are currently written in C
and were done so using the Megamax compiler.  They are designed to be
compiled into an object file.  Your program will then link in this object
file at the same time it links in the toolbox interface.  When you receive
the SimpleTools source, you should compile it into SimpleTools.o.  You can
then compile the demo, SimpleDemo, and link it to SimpleTools.o.

For example, lets say you want the menu items named "Zoom" and "Widen"
under the menu "View".  You would like the procedure:

	zoom()
	{
	 zoomfactor++;
	}

to be executed when the user selects Zoom and:

	widen()
	{
	 zoomfactor--;
	}

to execute when Widen is selected.  You would both create the menus on the
menu bar AND inform SimpleTools what to do with the calls:

	menu ("View", "Zoom", zoom);
	menu ("View", "Widen", widen);

Then, your program would run by repeatedly calling SimpleEvents, like:

	main()
	{
	 setup();
	 for (;;) SimpleEvents();
	}

Several other features are included in SimpleTools:

1.  Window creation with assignment of procedures to be executed on window
activation, deactivation, when the mouse is clicked in it, and when an
update occurs.

2.  Assignment of procedures to be "run" each time SimpleEvents() is
called.  This can easily make it look like multi-subroutines are running
concurrently.

3.  Generic prompt() and message() routines which pop up a small dialog box
for you.  For example:

	prompt("What is your name?", answer)

is all yo have to do to get a dialog box up requesting the user's name.
The answer goes into the string answer.

4.  Automatic setup of the Apple, File, and Edit menu so even your simplest
of programs will still have Desk Accessories.

5.  Many, many, hidden options that you will never know about unless you
care to know about them.  (This was a major design goal of SimpleTools--
hide options and use the most common default.)

This has just been a summary of the SimpleTools routines.  I'm sure you
could find them very useful.  Many users of SimpleTools have been very
pleased with this idea and have saved many hours of studying and
programming.  To those people, thanks for your letters, they are very
highly appreciated.

                                    Erik 

P.S.  If you don't have access to the network library, feel free to send a
self-addressed, stamped envelope and a disk (full of any goodies you have)
to Erik Kilk, 1325 Nord Ave #155, Chico, CA 95926, and I'll copy my master
disk for you.