                                        
   Any application created by the user is based around the program
'EasyWIMP', to which the user adds two sections of code. The first is a
series of simple calls to create the window and a variety of icons and icon
groups inside the window. 'EasyWIMP' then automatically handles all clicks
and key presses on the icons and when any change occurs in them, it calls
the second section of code to inform it of the new state of the icon/group.
This is termed and 'event' and the user's code simply needs to reflect the
new state of the icon/group that the event is concerned with.

   Before creating an application you need to create an application
directory. The easiest way to do this is to use your application shell
generator, assuming a default slot requirement of 32K. The user's code can
then be added to the end of 'EasyWIMP', which should then be saved in the
directory as '!RunImage'. The code is added to two procedures at the end of
'EasyWIMP'. The first is called 'set_up' and the first call in this should
be to 'create_window':

   DEFPROCcreate_window(title$,W%) - This creates the titled window with a
width of W% half characters (all X coordinates and icon widths supplied to
procedures are also specified in units of half a character). 

   Next come the calls to create the icons. These should added in the order
in which the icons are to appear in the window, from top left to bottom
right. Most of them are functions which return a unique group number so
that when an event occurs the user knows which group the event is concerned
with. As well as this, there are some parameters that are common to several
of the calls:

     X% : the x coordinate of the icon.
     Y% : the y coordinate of the icon in units of a character.
          Both of these assume an origin at the top left of the window. 
  text$ : the text that appears in the icon.
 title$ : if not null, this title appears to the left of the icon/group.
   opt$ : a list of options separated by a comma and ending with a comma.
 width% : the width of the icon.
   tab% : the spacing between a set of icons.

   The calls themselves are as follows:
                        
   DEFPROCtext(x%,y%,text$) - This creates a simple text icon with no border
or background. Clicks on this text are ignored and no event is generated.

   DEFFNonoff(X%,Y%,text$,on%) - This creates a text and sprite icon with
the desktop's opton or optoff icon on the left and the text on the right.
The parameter 'on%' determines which sprite is displayed, and clicking on
any part of the icon reverses the state and generates an event.

   DEFFNinput(X%,Y%,title$,init$,len%,width%) - This creates a writeable
icon which accepts up to 'len%' characters and initially contains the string
'init$'. A click on this icon cause the red caret to appear in the icon and
the text can be edited. While editing, there are three keys which have
special effects. Cursor up and cursor down will move the caret into the
previous or next writeable icon without generating an event, while pressing
RETURN generates an event which returns the string entered and then moves
the caret to the next writeable icon.
                        
   DEFFNaction(X%,Y%,opt$,width%,tab%) - This creates a group of icons of
the 'menu' type. When the pointer is over one of these icons the icon is
inverted, and clicking on the icon will generate an event.

   DEFFNradio(X%,Y%,title$,opt$,on%,tab%,indent%) - This creates a titled
group of text and sprite icons with the desktop's radioon or radiooff
sprites. The string opt$ specifies the options, and if they go off the right
hand edge of the window they move down a line and start at an X coordinate
of indent%. As the name radio suggests, only one of these icons will be on,
and initially this is specified by on%. When the user clicks on one of the
icons it's selected and an event is generated.

   DEFFNchoice(X%,Y%,title$,opt$,width%,on%) - This creates a group of three
icons which allow the user to select any one of the options specified in
opt$. After the title is a left arrow, followed by the current choice
(initially on%), and a right arrow. When the user clicks on one of the
arrow icons the next choice in the list is displayed in the central icon,
which then generates an event.                                       

   The second procedure to which the user adds code is called 'event'. The
parameters passed to this specify the icon/group that the event concerns and
the new state of that icon/group:

   DEFPROCevent(group%,b1%,b2%,on%,string$)

   group% - This is the group number of the icon/group concerned.

   b1% - For radio and action groups this is the number of the icon in the
group. For example, in a radio group of five options the first icon will be
number zero and the last number four. In choice icons b1% specifies the
current choice, the first choice being numbered zero.

   b2% - This is only used in choice icons, where it specifies the total
number of choices available.

   on% - This specifies whether the icon is selected (on) or not (off). It's
only of relevance to onoff icons.

   string$ - This is the string that the icon contains. For input icons this
string will have been entered by the user, and for choice icons this will be
the current choice.
            
   The easiest way to 'decode' these parameters is with a CASE structure for
'group%'. The WHEN statements of this should pick out the group that the
event is concerned with and call the relevant procedure with any of the
other parameters that the procedure requires.

   All the above may sound a little complicated, but as always it's much
simpler to use than it is to describe. An inspection of the extra code of
'!Serial' should help clear up any points on which you're not sure. 

   The '!RunImage' file for '!Serial' would take up about three pages in the
magazine. If this is too much for one issue, you could split it over two
issues, listing 'EasyWIMP' (2 pages) in the first and the '!Serial'
additions ( page) in the second. This would also show just how powerful
'EasyWIMP' is, with only a half page listing needed to create a useful
multi-tasking desktop WIMP application.