FTXUI
6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
examples/dom/paragraph.cpp
Go to the documentation of this file.
1
// Copyright 2020 Arthur Sonzogni. 全著作権所有。
2
// このソースコードの使用は、以下で見つけることができるMITライセンスによって管理されています。
3
// LICENSEファイル。
4
#include <chrono>
// for operator""s, chrono_literals
5
#include <
ftxui/screen/screen.hpp
>
// for Full, Screen
6
#include <iostream>
// for cout, ostream
7
#include <memory>
// for allocator, shared_ptr
8
#include <string>
// for string, operator<<
9
#include <thread>
// for sleep_for
10
11
#include "
ftxui/dom/elements.hpp
"
// for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element
12
#include "
ftxui/dom/node.hpp
"
// for Render
13
#include "
ftxui/screen/box.hpp
"
// for ftxui
14
15
using namespace
std::chrono_literals;
16
int
main
() {
17
using namespace
ftxui
;
18
std::string p =
19
R
"(確率論および統計学において、ベイズの定理(またはベイズの法則、ベイズの規則)は、ある事象に関連する可能性のある条件の事前知識に基づいて、その事象の確率を記述します。例えば、癌が年齢と関連している場合、ベイズの定理を使用することで、その人の年齢を知らない状態での癌の確率の評価と比較して、その人が癌である確率をより正確に評価するために年齢を使用できます。ベイズの定理の多くの応用の1つは、統計的推論への特定のアプローチであるベイズ推論です。適用される場合、ベイズの定理に含まれる確率は、異なる確率解釈を持つことがあります。ベイズ確率解釈では、この定理は、関連する証拠の入手可能性を考慮して、主観的な信頼度が合理的に変化すべき方法を表現します。ベイズ推論は、ベイズ統計学の基礎です。) ";
20
21
std::string reset_position;
22
while (true) {
23
auto document = vbox({
24
hflow(paragraph(p)),
25
separator(),
26
hflow(paragraph(p)),
27
separator(),
28
hbox({
29
hflow(paragraph(p)),
30
separator(),
31
hflow(paragraph(p)),
32
}),
33
}) |
34
border;
35
36
document = vbox(filler(), document);
37
38
// auto screen = Screen::Create(Dimension::Fit(document));
39
// Render(screen, document);
40
// screen.Print();
41
// getchar();
42
43
auto screen = Screen::Create(Dimension::Full());
44
Render(screen, document);
45
std::cout << reset_position;
46
screen.Print();
47
reset_position = screen.ResetPosition();
48
49
std::this_thread::sleep_for(0.01s);
50
}
51
52
return 0;
53
}
box.hpp
elements.hpp
main
int main()
Definition
examples/dom/paragraph.cpp:16
ftxui
FTXUI ftxui:: 名前空間
Definition
animation.hpp:9
node.hpp
screen.hpp