From a6dfe0ccf9d0e100d25f3bc68f0319c372a2e63a Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 21 Jul 2025 23:06:11 +0200 Subject: [PATCH] Mon 21 Jul 22:43:21 CEST 2025 --- js/x11/examples/simple/creategc.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 js/x11/examples/simple/creategc.js diff --git a/js/x11/examples/simple/creategc.js b/js/x11/examples/simple/creategc.js new file mode 100644 index 0000000..0b4efd0 --- /dev/null +++ b/js/x11/examples/simple/creategc.js @@ -0,0 +1,15 @@ +var x11 = require('../../lib'); + +var PointerMotion = x11.eventMask.PointerMotion; +x11.createClient(function(err, display) { + var X = display.client; + var root = display.screen[0].root; + var white = display.screen[0].white_pixel; + var black = display.screen[0].black_pixel; + + var wid = X.AllocID(); + X.CreateWindow(wid, root, 0, 0, 400, 300, 0, 0, 0, 0, { backgroundPixel: white, eventMask: PointerMotion }); + var gc = X.AllocID(); + X.CreateGC(gc, wid); + X.MapWindow(wid); +});