2015-02-21 10:49:15 +00:00
|
|
|
var blessed = require('../')
|
|
|
|
, screen;
|
|
|
|
|
|
|
|
screen = blessed.screen({
|
|
|
|
dump: __dirname + '/logs/noalt.log',
|
|
|
|
title: 'widget-noalt test',
|
2015-07-22 02:23:57 +00:00
|
|
|
noAlt: true,
|
|
|
|
warnings: true
|
2015-02-21 10:49:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
var list = blessed.list({
|
|
|
|
parent: screen,
|
|
|
|
align: 'center',
|
|
|
|
mouse: true,
|
|
|
|
keys: true,
|
|
|
|
vi: true,
|
|
|
|
width: '50%',
|
|
|
|
height: 'shrink',
|
|
|
|
//border: 'line',
|
2015-03-19 11:13:44 +00:00
|
|
|
top: 5,
|
|
|
|
//bottom: 2,
|
2015-02-21 10:49:15 +00:00
|
|
|
left: 0,
|
|
|
|
style: {
|
|
|
|
fg: 'blue',
|
|
|
|
bg: 'default',
|
|
|
|
selected: {
|
|
|
|
bg: 'green'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
items: [
|
|
|
|
'one',
|
|
|
|
'two',
|
|
|
|
'three'
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
|
|
|
list.select(0);
|
|
|
|
|
|
|
|
list.on('select', function(item) {
|
|
|
|
console.log(item.getText());
|
|
|
|
process.exit(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
screen.key('C-c', function() {
|
|
|
|
process.exit(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
list.focus();
|
|
|
|
|
|
|
|
screen.render();
|