chjj / blessed

A high-level terminal interface library for node.js.
Other
11.2k stars 528 forks source link

box cannot be aligned to any location #417

Open sinanakyazici opened 3 years ago

sinanakyazici commented 3 years ago

Hi, I have 5 boxes in layout. I cannot set their position. I want to put a box location where i want.

` var blessed = require("blessed"); var screen = blessed.screen({ smartCSR: true, });

var layout = blessed.layout({ parent: screen, top: "center", left: "center", width: "100%", height: "100%", border: "line", style: { bg: "red", border: { fg: "blue", }, }, });

blessed.box({ parent: layout, width: 20, content: "Hello World 1", align: "center", height: 3, border: "line", top: 10, left: 10, });

blessed.box({ parent: layout, width: 20, content: "Hello World 2", align: "center", height: 3, border: "line", top: 10, right: 10, });

blessed.box({ parent: layout, width: 20, content: "Hello World 3", align: "center", height: 3, border: "line", bottom: 10, left: 10, });

blessed.box({ parent: layout, width: 20, content: "Hello World 4", align: "center", height: 3, border: "line", bottom: 10, right: 10, });

blessed.box({ parent: layout, width: 20, content: "Hello World 5", align: "center", height: 3, border: "line", top: 'center', left: 'center', }); screen.render(); `