example. resize.
This commit is contained in:
parent
0b77cb0d27
commit
58b2bf8f74
14
lib/high.js
14
lib/high.js
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue