#include "gwin.user.h"
main()
{
float x,y,xold,yold;
float c = 1.0;

   USTART("high2",0.,640.,0.,400.);
   upset(G,"colo",1.0);
   uprint(G,10.,90.,"Press left mouse button, hold, drag, release");

   uset(G,"comp");

   uset(G,"ncli");
   uset(G,"fill");
   uuev.key = ' ';
   while (1==1){
      while(uuev.key != 'a'){
         if(ugrinc(G,&x,&y,&uuev)){UEND();exit(0);};
      }
      xold = x;
      yold = y;
      urect(G,xold,yold,xold+5.0,yold+5.0);

      while(uuev.key != 'A'){
         if(ugrinl(G,&x,&y,&uuev)){UEND();exit(0);};
         urect(G,xold,yold,xold+5.0,yold+5.0);
         urect(G,x,y,x+5.0,y+5.0);
         xold = x;
         yold = y;
      }
      uset(G,"ncom");
      urect(G,xold,yold,xold+5.0,yold+5.0);
      uset(G,"comp");
      c += 1.0;
      if(c > 14.0) c = 1.0;
      upset(G,"colo",c);
   }

   UEND();

}
