/* rubber.c basic rubber band */ /* Draw rectangle. left mouse down=first point */ /* Drag to second point. left mouse up=final point */ #include #include #include static Display *dpy; static Window window1; static GC gc_rubber; static Screen *screen; static int winWidth = 500; static int winHeight = 500; static int tracking = 0; /* left button down, sense motion */ static int startX = 0; static int startY = 0; static int currentX = 0; static int currentY = 0; void display(void); void rubberRect(int x0, int y0, int x1 , int y1) { /* can apply to all figures */ /* draw a rubber rectangle, mouse down, tracks mouse */ int x, y; x=x0; if(x1