mirror of
https://github.com/danbulant/node-x11
synced 2026-05-27 05:52:02 +00:00
more rects in FyllPolyRect example
This commit is contained in:
parent
cceceffa90
commit
f3d3c51942
1 changed files with 13 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ xclient.on('connect', function(display) {
|
||||||
var black = display.screen[0].black_pixel;
|
var black = display.screen[0].black_pixel;
|
||||||
|
|
||||||
var wid = X.AllocID();
|
var wid = X.AllocID();
|
||||||
|
console.log('wid: ' + wid);
|
||||||
X.CreateWindow(
|
X.CreateWindow(
|
||||||
wid, root,
|
wid, root,
|
||||||
10, 10, 400, 300,
|
10, 10, 400, 300,
|
||||||
|
|
@ -22,13 +23,23 @@ xclient.on('connect', function(display) {
|
||||||
X.MapWindow(wid);
|
X.MapWindow(wid);
|
||||||
|
|
||||||
var gc = X.AllocID();
|
var gc = X.AllocID();
|
||||||
|
console.log('GC: ' + gc);
|
||||||
X.CreateGC(gc, wid, { foreground: black, background: white } );
|
X.CreateGC(gc, wid, { foreground: black, background: white } );
|
||||||
|
|
||||||
X.on('event', function(ev) {
|
X.on('event', function(ev) {
|
||||||
if (ev.type == 12)
|
if (ev.type == 12)
|
||||||
{
|
{
|
||||||
X.PolyFillRectangle(wid, gc, [20, 30, 50, 90]);
|
X.PolyFillRectangle(wid, gc, [20, 30, 50, 90]);
|
||||||
|
X.PolyFillRectangle(wid, gc, [40, 50, 90, 10]);
|
||||||
|
X.PolyFillRectangle(wid, gc, [20, 80, 50, 30]);
|
||||||
|
|
||||||
} else if (ev.type == 6) {
|
} else if (ev.type == 6) {
|
||||||
console.log(ev.x, ev.y);
|
//console.log(ev.x, ev.y);
|
||||||
|
//console.log(X.replies);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
X.on('error', function(e) {
|
||||||
|
console.log(e);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
Loading…
Reference in a new issue