neo-blessed/test/widget-textarea.js

37 lines
567 B
JavaScript
Raw Normal View History

2013-07-28 19:29:07 +00:00
var blessed = require('../')
, screen;
2013-07-28 19:29:07 +00:00
screen = blessed.screen({
2015-04-16 23:16:55 +00:00
dump: __dirname + '/logs/textarea.log',
2015-07-22 02:23:57 +00:00
fullUnicode: true,
warnings: true
2013-07-28 19:29:07 +00:00
});
var box = blessed.textarea({
parent: screen,
// Possibly support:
// align: 'center',
2015-04-04 06:43:24 +00:00
style: {
bg: 'blue'
},
height: 'half',
width: 'half',
top: 'center',
left: 'center',
tags: true
});
screen.render();
screen.key('q', function() {
process.exit(0);
});
screen.key('i', function() {
box.readInput(function() {});
});
screen.key('e', function() {
box.readEditor(function() {});
});