From 3913d1778318cd0c6bfb871148d38abb33ec7fd3 Mon Sep 17 00:00:00 2001 From: nasr Date: Wed, 28 Jan 2026 13:13:40 +0100 Subject: checkpoint --- xlib-tutorial/prog-1.cc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 xlib-tutorial/prog-1.cc (limited to 'xlib-tutorial/prog-1.cc') diff --git a/xlib-tutorial/prog-1.cc b/xlib-tutorial/prog-1.cc new file mode 100644 index 0000000..3ba596b --- /dev/null +++ b/xlib-tutorial/prog-1.cc @@ -0,0 +1,29 @@ +// Written by Ch. Tronche (http://tronche.lri.fr:8000/) +// Copyright by the author. This is unmaintained, no-warranty free software. +// Please use freely. It is appreciated (but by no means mandatory) to +// acknowledge the author's contribution. Thank you. +// Started on Thu Jun 26 23:29:03 1997 + +// +// Xlib tutorial: 1st program +// Make a window appear on the screen. +// + +#include // Every Xlib program must include this +#include // I include this to test return values the lazy way +#include // So we got the profile for 10 seconds + +#define NIL (0) // A name for the void pointer + +main() +{ + Display *dpy = XOpenDisplay(NIL); + assert(dpy); + Window w = XCreateWindow(dpy, DefaultRootWindow(dpy), 0, 0, + 200, 100, 0, + CopyFromParent, CopyFromParent, CopyFromParent, + NIL, 0); + XMapWindow(dpy, w); + XFlush(dpy); + sleep(10); +} -- cgit v1.3