Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <X11/Xlib.h>
- static Window
- new_window(Display *d, const char *x)
- {
- const int s = DefaultScreen(d);
- Window w;
- w = XCreateSimpleWindow(d, RootWindow(d, s),
- 0, 0, 200, 200, 1,
- BlackPixel(d, s),
- WhitePixel(d, s));
- XStoreName(d, w, x);
- return w;
- }
- int
- main(void)
- {
- Display *d;
- Window w0, w1;
- d = XOpenDisplay(NULL);
- if (!d) return 1;
- w0 = new_window(d, "w0");
- w1 = new_window(d, "w1");
- XMapWindow(d, w1);
- XMapWindow(d, w0);
- for (;;) {
- XEvent e;
- XNextEvent(d, &e);
- }
- XCloseDisplay(d);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement