From f3d3c51942bbfc18fd68249e0ee442376abd67ee Mon Sep 17 00:00:00 2001 From: sidorares Date: Mon, 18 Jul 2011 18:30:34 +1000 Subject: [PATCH] more rects in FyllPolyRect example --- test/polyfillrect.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/polyfillrect.js b/test/polyfillrect.js index 70ff9c0..f66c6ed 100644 --- a/test/polyfillrect.js +++ b/test/polyfillrect.js @@ -11,6 +11,7 @@ xclient.on('connect', function(display) { var black = display.screen[0].black_pixel; var wid = X.AllocID(); + console.log('wid: ' + wid); X.CreateWindow( wid, root, 10, 10, 400, 300, @@ -22,13 +23,23 @@ xclient.on('connect', function(display) { X.MapWindow(wid); var gc = X.AllocID(); + console.log('GC: ' + gc); X.CreateGC(gc, wid, { foreground: black, background: white } ); + X.on('event', function(ev) { if (ev.type == 12) { X.PolyFillRectangle(wid, gc, [20, 30, 50, 90]); - } else if (ev.type == 6) { - console.log(ev.x, ev.y); + X.PolyFillRectangle(wid, gc, [40, 50, 90, 10]); + X.PolyFillRectangle(wid, gc, [20, 80, 50, 30]); + + } else if (ev.type == 6) { + //console.log(ev.x, ev.y); + //console.log(X.replies); } }); + + X.on('error', function(e) { + console.log(e); + }); }); \ No newline at end of file