#include "gwin.user.h"
main()
{
float x,y,xold,yold,xanchor,yanchor;

   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");
   upset(G,"colo",1.0);
   uset(G,"ncli");
   uuev.key = '\0';

   while (1==1){
      while(uuev.key != 'a'){
         if(ugrinc(G,&x,&y,&uuev)){UEND();exit(0);};
      }
      xanchor = x;   /* anchor point */
      yanchor = y;
      xold = x;
      yold = y;

      while (uuev.key != 'A'){
         if(ugrinl(G,&x,&y,&uuev)){UEND();exit(0);};
         urect(G,xanchor,yanchor,xold,yold);
         urect(G,xanchor,yanchor,x,y);
         xold = x;
         yold = y;
      }
   }
   UEND();
}
