neo-blessed/test/widget-image.js

30 lines
490 B
JavaScript
Raw Normal View History

2015-02-01 13:43:52 -08:00
var blessed = require('../')
, screen;
screen = blessed.screen({
dump: __dirname + '/logs/image.log',
smartCSR: true
});
var img = blessed.image({
parent: screen,
left: 'center',
top: 'center',
2015-02-01 14:01:55 -08:00
width: 'shrink',
height: 'shrink',
2015-02-01 13:43:52 -08:00
bg: 'green',
file: process.argv[2] || __dirname + '/test-image.png'
});
img.focus();
screen.key('i', function() {
screen.displayImage(img.options.file);
});
2015-02-01 13:43:52 -08:00
screen.key('q', function() {
return process.exit(0);
});
screen.render();