home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d571
/
gwin.lha
/
Gwin
/
Examples
/
rubberbandbox.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-22
|
719b
|
35 lines
#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();
}