This commit is contained in:
Christopher Jeffrey 2013-07-17 10:29:42 -05:00
parent 1838f2d720
commit 54445e3f3c
2 changed files with 80 additions and 0 deletions

48
test/widget-listbar.js Normal file
View File

@ -0,0 +1,48 @@
var blessed = require('blessed')
, screen; screen = blessed.screen();
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();

View File

@ -0,0 +1,32 @@
var blessed = require('blessed')
, screen = blessed.screen();
var outer = blessed.box({
parent: screen,
//left: 0,
//top: 0,
//left: '50%',
//top: '50%',
left: 'center',
top: 'center',
padding: 1,
shrink: true,
bg: 'green'
});
var inner = blessed.box({
parent: outer,
left: 0,
top: 0,
width: 5,
height: 5,
//padding: 1,
//content: 'f',
bg: 'magenta'
});
screen.key('q', function() {
return process.exit(0);
});
screen.render();