From ede7c8de99586a8342272c9acfd158c1d2f3c573 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 21 Jul 2025 23:05:46 +0200 Subject: [PATCH] Mon 21 Jul 22:43:21 CEST 2025 --- js/x11/examples/smoketest/cleararea.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 js/x11/examples/smoketest/cleararea.js diff --git a/js/x11/examples/smoketest/cleararea.js b/js/x11/examples/smoketest/cleararea.js new file mode 100644 index 0000000..eedff2a --- /dev/null +++ b/js/x11/examples/smoketest/cleararea.js @@ -0,0 +1,15 @@ +var x11 = require('../../lib'); +var Window = require('./wndwrap'); + +x11.createClient(function(err, display) { + var X = display.client; + var w = new Window(X, 0, 0, 700, 500); + w.map(); + + w.on('expose', function() { + var gc = X.AllocID(); + X.CreateGC(gc, w.id, { foreground: w.black, background: w.white }); + X.PolyFillRectangle(w.id, gc, [50, 50, 600, 400]); + X.ClearArea(w.id, 0, 0, 300, 300, 0); + }); +});