|
CPGen
C++ project generator
|
Root TUI manager: renders sections, routes input, and runs the event loop. More...
#include <View.hpp>
Public Member Functions | |
| void | addSection (std::unique_ptr< Component > section) |
| Append a top-level section to the view. | |
| void | run () |
| Start the blocking TUI event loop. | |
Root TUI manager: renders sections, routes input, and runs the event loop.
The run method constructs a Terminal (entering raw mode), then loops reading keys from stdin via Utils::readKey. Each key is first offered to the currently focused section; if not consumed, View handles Defs::Special::Tab to move focus between sections and Defs::Special::Escape to exit the loop.
After every input event the entire screen is redrawn via redraw.
| void View::addSection | ( | std::unique_ptr< Component > | section | ) |
Append a top-level section to the view.
Ownership is transferred. The first section added automatically receives focus when run starts.
| section | A component to display as a top-level section. |
| void View::run | ( | ) |
Start the blocking TUI event loop.
