mirror of
https://github.com/chjj/blessed.git
synced 2026-02-06 13:16:49 +00:00
helper.
This commit is contained in:
parent
144dcce30a
commit
c8007331b0
@ -8339,6 +8339,10 @@ helpers.parseTags = function(text) {
|
||||
|
||||
helpers.generateTags = generateTags;
|
||||
|
||||
helpers.textLength = function(text) {
|
||||
return Element.prototype.textLength.call({ options: { tags: true } }, text);
|
||||
};
|
||||
|
||||
helpers.attrToBinary = function(obj, fg, bg, target) {
|
||||
return Element.prototype.sattr.call(target || {}, obj, fg, bg);
|
||||
};
|
||||
|
||||
32
test/widget-autopad.js
Normal file
32
test/widget-autopad.js
Normal file
@ -0,0 +1,32 @@
|
||||
var blessed = require('../')
|
||||
, screen;
|
||||
|
||||
screen = blessed.screen({
|
||||
dump: __dirname + '/logs/autopad.log',
|
||||
smartCSR: true,
|
||||
autoPadding: true
|
||||
});
|
||||
|
||||
var box1 = blessed.box({
|
||||
parent: screen,
|
||||
top: 'center',
|
||||
left: 'center',
|
||||
width: 20,
|
||||
height: 10,
|
||||
border: 'line'
|
||||
});
|
||||
|
||||
var box2 = blessed.box({
|
||||
parent: box1,
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: 10,
|
||||
height: 5,
|
||||
border: 'line'
|
||||
});
|
||||
|
||||
screen.key('q', function() {
|
||||
return process.exit(0);
|
||||
});
|
||||
|
||||
screen.render();
|
||||
Loading…
Reference in New Issue
Block a user