mirror of
https://github.com/danbulant/node-x11
synced 2026-05-20 12:58:45 +00:00
replace timeout with expose
This commit is contained in:
parent
45ab095ef2
commit
33f953db32
1 changed files with 2 additions and 5 deletions
|
|
@ -6,13 +6,10 @@ x11.createClient(function(err, display) {
|
|||
var w = new Window(X, 0, 0, 700, 500);
|
||||
w.map();
|
||||
|
||||
var render = function() {
|
||||
//X.ChangeGC(w.gc.id, { foreground: w.black, background: w.white });
|
||||
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);
|
||||
}
|
||||
|
||||
setTimeout(render, 100); // sometimes doesn't render without a delay
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue