therealbluepandabear 5efc1498cd Add some `enforce` blocks for safety reasons. | 1 год назад | |
---|---|---|
.idea | 2 лет назад | |
source | 1 год назад | |
.gitignore | 2 лет назад | |
DTui.iml | 2 лет назад | |
README.md | 1 год назад | |
dub.json | 2 лет назад |
🚧 WIP 🚧 Terminal user interface library for D language
DTui is a terminal user interface (TUI) library for D language that I am working on in my free time to help better understand D.
Keep in mind:
The library's first version has not been released yet.
Note that I am new to D so this is not a professional project.
Output images are in the IntelliJ IDEA 'Run' window.
void main() {
Canvas canvas = new Canvas();
Tree tree = new Tree(Node("A", Node("B1", Node("C1"), Node("C2")), Node("B2", Node("D1"), Node("D2")), Node("B3", Node("E1"), Node("E2"))));
canvas.updateCache(tree, Coordinate(0, 0));
canvas.drawCache();
}
void main() {
Canvas canvas = new Canvas();
Chart chart = new Chart(ChartType.column, [1, 4, 9, 2], 3, 1, Color.Red);
canvas.updateCache(chart, Coordinate(0, 0));
canvas.drawCache();
}
void main() {
Canvas canvas = new Canvas();
Rect rect = Rect.withFill(Dimensions(20, 10), Color.Orange);
canvas.updateCache(rect, Coordinate(0, 0));
canvas.drawCache();
}
void main() {
Canvas canvas = new Canvas();
Rect rect = Rect.withFrame(Dimensions(20, 10), Color.Blue);
canvas.updateCache(rect, Coordinate(0, 0));
canvas.drawCache();
}
void main() {
Canvas canvas = new Canvas();
Table table = new Table(10, 5);
canvas.updateCache(table, Coordinate(0, 0));
canvas.drawCache();
}
void main() {
Canvas canvas = new Canvas();
Label label = new Label(Rect.withFill(Dimension.block(30, 11), Color.Black), "Hello World!", Color.Orange);
canvas.updateCache(label, Coordinate(0, 0));
canvas.drawCache();
}
void main() {
Canvas canvas = new Canvas();
Rect rectr = Rect.withFill(Dimension(10, 10), Color.Blue);
Rect rectb = Rect.withFill(Dimension(10, 10), Color.Red);
StackLayout row = new StackLayout(StackLayoutType.row);
row.add(rectr, rectb, rectr, rectb, rectr);
canvas.updateCache(row, Coordinate(0, 0));
canvas.drawCache();
}