neo-blessed/test/widget-listbar.js

53 lines
689 B
JavaScript
Raw Normal View History

2013-07-18 22:56:05 +00:00
var blessed = require('../')
2013-07-28 19:29:07 +00:00
, screen;
screen = blessed.screen({
dump: __dirname + '/logs/listbar.log'
});
2013-07-17 15:29:42 +00:00
var bar = blessed.listbar({
parent: screen,
bottom: 0,
left: 0,
mouse: true,
keys: true,
shrinkBox: true,
style: {
bg: 'green',
item: {
bg: 'red',
hover: {
bg: 'blue'
},
focus: {
fg: 'blue'
}
},
},
items: [
'one',
'two',
'three',
'four',
'five',
'six',
'seven',
'eight',
'nine',
'ten',
'eleven',
'twelve',
'thirteen',
'fourteen',
'fifteen'
]
});
bar.focus();
screen.key('q', function() {
return process.exit(0);
});
screen.render();