Skip to content

🚧 WIP 🚧 Terminal user interface library for D language

Notifications You must be signed in to change notification settings

therealbluepandabear/DTui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

94 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DTui

🚧 WIP 🚧 Terminal user interface library for D language

About

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:

  1. The library's first version has not been released yet.

  2. Note that I am new to D so this is not a professional project.

  3. Output images are in the IntelliJ IDEA 'Run' window.

Controls

Tree

Construction:

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();
}

Output:

image

Chart

Construction:

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();
}

Output:

image

Rect (with fill)

Construction

void main() {
  Canvas canvas = new Canvas();

  Rect rect = Rect.withFill(Dimensions(20, 10), Color.Orange);

  canvas.updateCache(rect, Coordinate(0, 0));
  canvas.drawCache();
}

Output:

image

Rect (with frame)

Construction

void main() {
  Canvas canvas = new Canvas();

  Rect rect = Rect.withFrame(Dimensions(20, 10), Color.Blue);

  canvas.updateCache(rect, Coordinate(0, 0));
  canvas.drawCache();
}

Output

image

Table

Construction

void main() {
  Canvas canvas = new Canvas();

  Table table = new Table(10, 5);

  canvas.updateCache(table, Coordinate(0, 0));
  canvas.drawCache();
}

Output

image

Label

Construction

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();
}

Output

image

StackLayout

Construction

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();
}

Output

image

About

🚧 WIP 🚧 Terminal user interface library for D language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages