home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d571 / gwin.lha / Gwin / Examples / placeobject.c < prev    next >
C/C++ Source or Header  |  1991-12-22  |  849b  |  42 lines

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