example. resize.

This commit is contained in:
Christopher Jeffrey 2013-05-31 21:44:43 -05:00
parent 0b77cb0d27
commit 58b2bf8f74
1 changed files with 14 additions and 0 deletions

View File

@ -7,6 +7,7 @@
API Example:
This will render a box with ascii borders containing the
text 'Hello world!', centered horizontally and vertically.
var blessed = require('blessed')
, program = blessed()
, screen;
@ -29,6 +30,12 @@
left: 'center'
}));
program.on('keypress', function(ch, key) {
if (key.name === 'escape') {
process.exit(0);
}
});
screen.render();
*/
@ -81,6 +88,13 @@ function Screen(options) {
}
this.lines[y].dirty = true;
}
var self = this;
this.program.on('resize', function() {
self.cols = program.cols;
self.rows = program.rows;
self.render();
});
}
Screen.prototype.__proto__ = Node.prototype;