2020-02-03 23:05:41 +08:00
|
|
|
# Level of abstractions:
|
2018-10-10 01:06:03 +08:00
|
|
|
* Level 0: terminal output.
|
|
|
|
* Level 1: ftxui::Screen
|
2019-01-12 22:00:08 +08:00
|
|
|
* Level 2: ftxui::Node
|
|
|
|
* Level 3: ftxui::Component
|
2018-10-10 01:06:03 +08:00
|
|
|
|
|
|
|
## Level 0: terminal output.
|
2020-02-03 23:05:41 +08:00
|
|
|
This is std::cout. You can send text to it.
|
2018-10-10 01:06:03 +08:00
|
|
|
|
|
|
|
## Level 1: ftxui::Screen
|
|
|
|
A rectangular grid of characters.
|
2020-02-03 23:05:41 +08:00
|
|
|
Use Terminal::ToString() to append its content to the console (level 0).
|
2018-10-10 01:06:03 +08:00
|
|
|
|
2019-01-12 22:00:08 +08:00
|
|
|
## Level 2: ftxui::Node
|
2020-02-03 23:05:41 +08:00
|
|
|
A hierarchial set of element.
|
|
|
|
They handle layout and render themself on the screen (level 1)
|
2020-02-04 18:48:01 +08:00
|
|
|
See [elements.hpp](./dom/elements.hpp)
|
2018-10-10 01:06:03 +08:00
|
|
|
|
|
|
|
You can make implement your own.
|
|
|
|
|
2019-01-12 22:00:08 +08:00
|
|
|
## Level 3: ftxui::Component
|
2020-02-03 23:05:41 +08:00
|
|
|
A hierarchical set of components.
|
|
|
|
Components store some state and react to events:
|
2020-02-04 18:48:01 +08:00
|
|
|
* keyboard
|
|
|
|
* mouse
|
|
|
|
* terminal event
|
|
|
|
|
2020-02-03 23:05:41 +08:00
|
|
|
Components renders themself by producing ftxui::Node (Level 2)
|
2018-10-10 01:06:03 +08:00
|
|
|
|
2018-10-21 20:18:11 +08:00
|
|
|
Implement your own!
|