		      GLG: A GL Gadgets Package


			    Mark Phillips
			      June 1990

Glg is a library which lets you create graphical user interface
gadgets such as sliders and buttons in GL programs.  It's a modest
creation, but it gets the job done.

Glg is extensible --- you can add a new gadget type by creating a data
type for it and specifying procedures which draw it and interpret
events, such as button presses, for it.  See below for instructions.

See the demo program 'glgdemo.c' for an example of how to use glg.

List of files:

	glg.c: Main file.  Defines the main glg event procedures and
		some utilitity functions which the gadget definition
		files can use if they want.

	glg.h: Header file.  It should be #included by any application
		program that uses glg.

	internal.h: Header file for global object definitions shared
		among glg files, but which should not be available
		to application programs.

	sliders.c: Slider definition file.
	sliders.h: Slider header file.

	buttons.c: Button definition file.
	buttons.h: Button header file.

	messages.c: Message definition file.
	messages.h: Message header file.
			(A 'message' is simply a text string)

	texts.c: Text definition file.
	texts.h: Text header file.
			(A 'text' is a gadget into which the user
			can type text)

	glgdemo.c: Demo program.

How to add a new gadget:

	1. Write a typedef definition for it; put this in a header
	   file called, for example, newgadget.h.  Assume, for the
	   rest of these instructions, that your new type name is
	   'GlgNewgadget'.

	2. Write a function which draws an instance of the new gadget.
	   This function should accept an argument to a GlgNewgadget
	   object and should draw the corresponding gadget.

	3. Write a function which interprets events for the new
	   gadget type.  See the existing gadget files
	   (sliders.c, buttons.c, messages.c, texts.c) for
	   examples pattern your function after.  Note that this
	   function must make sure the gadget wants the event;
	   the utility function GlgEventInRect can be used for
	   this purpose.
	
	4. Write a macro in your header file for creating an instance
	of your new gadget.  See the existing header files (sliders.h,
	buttons.h, messages.h, texts.h) for examples.

There should be more documentation for glg.  I'm sorry that there isn't,
but I don't have the time to write it now.  Volunteers are welcome!

--mbp	Fri Jun  8 15:31:58 1990
