Mon 21 Jul 22:43:21 CEST 2025
This commit is contained in:
parent
a39024db26
commit
e434ab71b3
26
js/x11/examples/simple/lsatoms.js
Normal file
26
js/x11/examples/simple/lsatoms.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
var x11 = require('../../lib');
|
||||
x11.createClient(function(err, display) {
|
||||
var maxstd = 0;
|
||||
var atomName;
|
||||
for (atomName in display.atoms)
|
||||
{
|
||||
var id = display.atoms[atomName];
|
||||
console.log(id + '\t' + atomName);
|
||||
if (id > maxstd)
|
||||
maxstd = id;
|
||||
}
|
||||
(
|
||||
function getAtoms(atomId)
|
||||
{
|
||||
display.client.GetAtomName(atomId, function(err, atom) {
|
||||
if (err) {
|
||||
display.client.terminate();
|
||||
return true;
|
||||
} else {
|
||||
console.log(atomId + '\t' + atom);
|
||||
getAtoms(atomId +1);
|
||||
}
|
||||
});
|
||||
}
|
||||
)(maxstd+1);
|
||||
});
|
Loading…
Reference in New Issue
Block a user