neo-blessed/test/widget-obscure-sides.js

73 lines
992 B
JavaScript
Raw Normal View History

var blessed = require('../');
var screen = blessed.screen({
tput: true,
smartCSR: true,
dump: __dirname + '/logs/obscure-sides.log',
2015-07-22 02:23:57 +00:00
autoPadding: true,
warnings: true
});
var box = blessed.box({
parent: screen,
scrollable: true,
alwaysScroll: true,
border: {
type: 'bg',
2015-04-04 06:43:24 +00:00
ch: ' '
},
style: {
bg: 'blue',
border: {
inverse: true
2015-04-04 06:43:24 +00:00
},
scrollbar: {
bg: 'white'
}
},
height: 10,
width: 30,
top: 'center',
left: 'center',
cwd: process.env.HOME,
keys: true,
vi: true,
scrollbar: {
ch: ' '
}
});
var child = blessed.box({
parent: box,
content: 'hello',
2015-04-04 06:43:24 +00:00
style: {
bg: 'green'
},
2015-04-04 06:43:24 +00:00
// border: 'line',
height: 5,
width: 20,
top: 2,
left: 15
});
var child2 = blessed.box({
parent: box,
content: 'hello',
2015-04-04 06:43:24 +00:00
style: {
bg: 'green',
},
2015-04-04 06:43:24 +00:00
border: 'line',
height: 5,
width: 20,
top: 25,
left: -5
});
box.focus();
screen.render();
screen.key('q', function() {
screen.destroy();
});