NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
neforce::tui::application类 参考

TUI应用程序入口 更多...

#include <application.hpp>

Public 成员函数

template<typename RootComponent, typename... Args>
application & with_component (Args &&... args)
 设置根组件
application & with_theme (const theme &theme)
 设置主题
application & with_fps (int fps)
 设置最大刷新帧率
application & with_title (string title)
 设置程序名
int run ()
 阻塞运行事件循环
void quit (int exit_code=0)
 请求退出应用

详细描述

TUI应用程序入口

驱动主事件循环。

int main() {
return application()
.with_component<my_root_component>()
.with_fps(60)
.run();
}
application & with_fps(int fps)
设置最大刷新帧率
int run()
阻塞运行事件循环
application & with_theme(const theme &theme)
设置主题
constexpr theme dark_theme
预置暗色主题

在文件 application.hpp43 行定义.

成员函数说明

◆ quit()

void neforce::tui::application::quit ( int exit_code = 0)

请求退出应用

参数
exit_code退出码

◆ run()

int neforce::tui::application::run ( )

阻塞运行事件循环

返回
退出码

◆ with_component()

template<typename RootComponent, typename... Args>
application & neforce::tui::application::with_component ( Args &&... args)
inline

设置根组件

模板参数
RootComponent根组件类型
Args构造参数类型
参数
args构造参数
返回
自身引用

在文件 application.hpp61 行定义.

引用了 neforce::forward() , 以及 neforce::make_unique().

◆ with_fps()

application & neforce::tui::application::with_fps ( int fps)

设置最大刷新帧率

参数
fps帧率(0 表示仅事件驱动刷新)
返回
自身引用

◆ with_theme()

application & neforce::tui::application::with_theme ( const theme & theme)

设置主题

参数
theme主题
返回
自身引用

◆ with_title()

application & neforce::tui::application::with_title ( string title)

设置程序名

参数
title程序名
返回
自身引用

该类的文档由以下文件生成: