From f3b0db045311857b140ee3cb6028f884051a38a9 Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Mon, 6 Jun 2011 21:57:52 -0700 Subject: [PATCH] Edited README.md via GitHub --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 8a82675..6a1eedf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,25 @@ # About X11 protocol client for node.js +# example + + var x = require('x11'); + + var s = x.createConnection().defaultScreen(); + var wnd = s.createWindow(10, 10, 100, 100); // RootWindow as parent by default + wnd.selectInput(x.ExposureMask | x.KeyPressMask); // optional, all input by default + wnd + .on('expose', function(exposeevent) + { + this.drawString(10, 50, 'Hello'); + }) + .on('keypress', function(keyevent) + { + process.exit(0); + }); + + + # Protocol documentation - http://www.x.org/releases/X11R7.6/doc/