2013-07-19 06:57:17 +00:00
|
|
|
var blessed = require('../')
|
|
|
|
, screen = blessed.screen();
|
|
|
|
|
|
|
|
var box = blessed.scrollablebox({
|
|
|
|
//var box = blessed.scrollabletext({
|
|
|
|
parent: screen,
|
|
|
|
left: 'center',
|
|
|
|
top: 'center',
|
|
|
|
width: '80%',
|
|
|
|
height: '80%',
|
|
|
|
bg: 'green',
|
|
|
|
border: {
|
|
|
|
type: 'ascii'
|
|
|
|
},
|
|
|
|
content: 'foobar',
|
|
|
|
keys: true,
|
|
|
|
vi: true,
|
|
|
|
alwaysScroll: true,
|
|
|
|
scrollbar: {
|
|
|
|
ch: ' ',
|
|
|
|
inverse: true
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var text = blessed.box({
|
|
|
|
parent: box,
|
2013-07-25 02:21:20 +00:00
|
|
|
content: 'hello1\nhello2\nhello3\nhello4',
|
2013-07-19 06:57:17 +00:00
|
|
|
style: {
|
|
|
|
bg: 'red'
|
|
|
|
},
|
|
|
|
left: 2,
|
|
|
|
top: 30,
|
|
|
|
width: '50%',
|
2013-07-25 02:21:20 +00:00
|
|
|
height: 6
|
2013-07-19 06:57:17 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
var text2 = blessed.box({
|
|
|
|
parent: box,
|
|
|
|
content: 'world',
|
|
|
|
style: {
|
|
|
|
bg: 'red'
|
|
|
|
},
|
|
|
|
left: 2,
|
|
|
|
top: 50,
|
|
|
|
width: '50%',
|
|
|
|
height: 3
|
|
|
|
});
|
|
|
|
|
|
|
|
screen.key('q', function() {
|
|
|
|
return process.exit(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
box.focus();
|
|
|
|
|
|
|
|
screen.render();
|