How to use the Box function from blessed
Find comprehensive JavaScript blessed.Box code examples handpicked from public code repositorys.
14 15 16 17 18 19 20 21 22 23 24 25
function checkHighscore({ game, screen }) { const lowestScore = highscores.reduce((a, b) => Math.min(a, b.score), Infinity); if (highscores.length < 10 || game.score > lowestScore) { const prompt = new Box({ parent: screen, width: 40, height: `shrink`, border: 'line',
2
44
0
29 30 31 32 33 34 35 36 37 38
}, bottom: 0, left: 'center', }); const title = new Box({ parent: screen, width: 'shrink', height: 3, content: '',
2
44
0
+ 5 other calls in file
GitHub: fazo96/telecommander
21 22 23 24 25 26 27 28 29 30
self.focus() self.screen.render() }) } ChatBox.prototype.__proto__ = blessed.Box.prototype ChatBox.prototype.type = 'chatbox' ChatBox.prototype.add = ChatBox.prototype.log = function(){ var text = Array.prototype.slice.call(arguments).join(' ') this.pushLine(text)
2
32
2
+ 17 other calls in file
0 1 2 3 4 5 6 7 8 9 10 11
const util = require('util'); const { Screen, Box, BigText, FileManager, Text, Button } = require('blessed'); module.exports = function (screen) { const container = new Box({ parent: screen, left: 0, bottom: 0, height: '50%',
2
8
0
2 3 4 5 6 7 8 9 10 11 12
// dependencies var blessed = require('blessed'); // Contrib = require('blessed-contrib'), // ContribTable = Contrib.table, var ContribTable = require('./blessed-contrib/table'); var BlessedBox = blessed.Box; // project includes // var {SummaryTableConfig} = require('./widget_SummaryListTable'); var {TimetrapTUI_Error} = require('./Errors');
1
1
2
+ 43 other calls in file
2 3 4 5 6 7 8 9 10 11 12
// dependencies var blessed = require('blessed'); // Contrib = require('blessed-contrib'), // ContribTable = Contrib.table; var ContribTable = require('./blessed-contrib/table'); // BlessedBox = blessed.Box; // project includes // var {SummaryTableConfig} = require('./widget_SummaryListTable'); var {TimetrapTUI_Error} = require('./Errors');
1
1
2
+ 17 other calls in file
GitHub: jpfeiffer16/dotdbg
1 2 3 4 5 6 7 8 9 10 11
// I've just made a couple of modifications. // TODO: Get this upstreamed "use strict"; var blessed = require('blessed'), Node = blessed.Node, Box = blessed.Box; function Tree(options) { if (!(this instanceof Node)) { return new Tree(options);
0
5
2
+ 4 other calls in file
GitHub: moofoo/dnv
371 372 373 374 375 376 377 378 379 380
if (this.style.transparent) { options.transparent = true; } var item = new blessed.Box(options); item.dattr = item.sattr({ fg: 'white', bg: 'black' }); item.itemName = typeof content === 'object' ? content.name : content;
0
0
0
GitHub: dampbacon/js
47 48 49 50 51 52 53 54 55 56
if (this.style.transparent) { options.transparent = true; } var item = new Box(options); if (this.mouse) { item.on('click', function() { self.focus();
0
0
0
blessed.box is the most popular function in blessed (4356 examples)