CPGen
C++ project generator
Loading...
Searching...
No Matches
Classes
View.hpp File Reference

Top-level TUI view that owns all sections and drives the main event loop. More...

#include "Components/Component.hpp"
#include <memory>
#include <vector>
Include dependency graph for View.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  View
 Root TUI manager: renders sections, routes input, and runs the event loop. More...
 

Detailed Description

Top-level TUI view that owns all sections and drives the main event loop.

Author
Darleanow

View is the root of the component tree. It holds a flat list of top-level components (called sections — typically ComponentGroup or Input instances), manages focus between them with Defs::Special::Tab, and runs the blocking input loop.

Typical setup

View view;
view.addSection(std::make_unique<ComponentGroup>("Settings",
Ascii::GEAR_ICON)); view.addSection(std::make_unique<Input>("Project Name",
callback)); view.run(); // blocks until the user presses Escape
Root TUI manager: renders sections, routes input, and runs the event loop.
Definition View.hpp:40
void addSection(std::unique_ptr< Component > section)
Append a top-level section to the view.
Definition View.cpp:12
void run()
Start the blocking TUI event loop.
Definition View.cpp:38
constexpr const char * GEAR_ICON
Settings / configuration icon.
Definition Ascii.hpp:60