diff options
Diffstat (limited to 'xlib-tutorial/prog-1.cc')
| -rw-r--r-- | xlib-tutorial/prog-1.cc | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/xlib-tutorial/prog-1.cc b/xlib-tutorial/prog-1.cc deleted file mode 100644 index 3ba596b..0000000 --- a/xlib-tutorial/prog-1.cc +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | // Written by Ch. Tronche (http://tronche.lri.fr:8000/) | ||
| 2 | // Copyright by the author. This is unmaintained, no-warranty free software. | ||
| 3 | // Please use freely. It is appreciated (but by no means mandatory) to | ||
| 4 | // acknowledge the author's contribution. Thank you. | ||
| 5 | // Started on Thu Jun 26 23:29:03 1997 | ||
| 6 | |||
| 7 | // | ||
| 8 | // Xlib tutorial: 1st program | ||
| 9 | // Make a window appear on the screen. | ||
| 10 | // | ||
| 11 | |||
| 12 | #include <X11/Xlib.h> // Every Xlib program must include this | ||
| 13 | #include <assert.h> // I include this to test return values the lazy way | ||
| 14 | #include <unistd.h> // So we got the profile for 10 seconds | ||
| 15 | |||
| 16 | #define NIL (0) // A name for the void pointer | ||
| 17 | |||
| 18 | main() | ||
| 19 | { | ||
| 20 | Display *dpy = XOpenDisplay(NIL); | ||
| 21 | assert(dpy); | ||
| 22 | Window w = XCreateWindow(dpy, DefaultRootWindow(dpy), 0, 0, | ||
| 23 | 200, 100, 0, | ||
| 24 | CopyFromParent, CopyFromParent, CopyFromParent, | ||
| 25 | NIL, 0); | ||
| 26 | XMapWindow(dpy, w); | ||
| 27 | XFlush(dpy); | ||
| 28 | sleep(10); | ||
| 29 | } | ||
