2013-08-01 09:11:22 +00:00
|
|
|
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
|
2013-08-01 09:11:22 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
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: {
|
2013-08-01 09:11:22 +00:00
|
|
|
inverse: true
|
2015-04-04 06:43:24 +00:00
|
|
|
},
|
|
|
|
scrollbar: {
|
|
|
|
bg: 'white'
|
2013-08-01 09:11:22 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
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'
|
2013-08-01 09:11:22 +00:00
|
|
|
},
|
2015-04-04 06:43:24 +00:00
|
|
|
// border: 'line',
|
2013-08-01 09:11:22 +00:00
|
|
|
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',
|
2013-08-01 09:11:22 +00:00
|
|
|
},
|
2015-04-04 06:43:24 +00:00
|
|
|
border: 'line',
|
2013-08-01 09:11:22 +00:00
|
|
|
height: 5,
|
|
|
|
width: 20,
|
|
|
|
top: 25,
|
|
|
|
left: -5
|
|
|
|
});
|
|
|
|
|
|
|
|
box.focus();
|
|
|
|
|
|
|
|
screen.render();
|
|
|
|
|
|
|
|
screen.key('q', function() {
|
2015-08-08 04:00:31 +00:00
|
|
|
screen.destroy();
|
2013-08-01 09:11:22 +00:00
|
|
|
});
|