zlatkart
October 14th, 2009, 10:04 PM
Hi all
1. I use this code to draw on the root window, but somehow i can't work out how to erase this.
2. Is there an easy way to use colours for XDraw...
Display *dpy = XOpenDisplay(NULL);
Window win=XDefaultRootWindow(dpy);
XMapWindow(dpy,win );
int blackColor = BlackPixel(dpy, DefaultScreen(dpy));
GC gc = XCreateGC(dpy,win, 0, NULL);
XSetForeground(dpy, gc, blackColor);
XSetSubwindowMode(dpy, gc, IncludeInferiors);
XDrawRectangle(dpy, win, gc, 0,0, 100,100);
XFlush(dpy);
XCloseDisplay(dpy);
1. I use this code to draw on the root window, but somehow i can't work out how to erase this.
2. Is there an easy way to use colours for XDraw...
Display *dpy = XOpenDisplay(NULL);
Window win=XDefaultRootWindow(dpy);
XMapWindow(dpy,win );
int blackColor = BlackPixel(dpy, DefaultScreen(dpy));
GC gc = XCreateGC(dpy,win, 0, NULL);
XSetForeground(dpy, gc, blackColor);
XSetSubwindowMode(dpy, gc, IncludeInferiors);
XDrawRectangle(dpy, win, gc, 0,0, 100,100);
XFlush(dpy);
XCloseDisplay(dpy);