diff --git a/test/widget-listbar.js b/test/widget-listbar.js new file mode 100644 index 0000000..baf4177 --- /dev/null +++ b/test/widget-listbar.js @@ -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(); diff --git a/test/widget-shrink-padding.js b/test/widget-shrink-padding.js new file mode 100644 index 0000000..1bdd25e --- /dev/null +++ b/test/widget-shrink-padding.js @@ -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();