2015-02-21 10:49:15 +00:00
|
|
|
var blessed = require('../')
|
|
|
|
, screen;
|
|
|
|
|
|
|
|
screen = blessed.screen({
|
|
|
|
dump: __dirname + '/logs/noalt.log',
|
|
|
|
title: 'widget-noalt test',
|
|
|
|
noAlt: true
|
|
|
|
});
|
|
|
|
|
|
|
|
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();
|