home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk433.lzh / Gwin / exsrc.lzh / placeobject.c < prev    next >
C/C++ Source or Header  |  1991-01-12  |  785b  |  42 lines

  1. #include "gwin.user.h"
  2. main()
  3. {
  4. float x,y,xold,yold,event;
  5. float c = 1.0;
  6. char key = '\0';
  7.  
  8.    ustart("high2",0.,640.,0.,400.);
  9.    upset("colo",1.0);
  10.    uprint(10.,90.,"Press left mouse button, hold, drag, release");
  11.  
  12.    uset("comp");
  13.  
  14.    uset("ncli");
  15.    uset("fill");
  16.    while (1==1){
  17.       while(key != 'a'){
  18.          ugrinc(&x,&y,&event,&key);
  19.       }
  20.       xold = x;
  21.       yold = y;
  22.       urect(xold,yold,xold+5.0,yold+5.0);
  23.  
  24.       while(key != 'A'){
  25.          ugrinl(&x,&y,&event,&key);
  26.          urect(xold,yold,xold+5.0,yold+5.0);
  27.          urect(x,y,x+5.0,y+5.0);
  28.          xold = x;
  29.          yold = y;
  30.       }
  31.       uset("ncom");
  32.       urect(xold,yold,xold+5.0,yold+5.0);
  33.       uset("comp");
  34.       c += 1.0;
  35.       if(c > 14.0) c = 1.0;
  36.       upset("colo",c);
  37.    }
  38.  
  39.    uend();
  40.  
  41. }
  42.