forked from SAtacker/quick-ftxui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.cpp
51 lines (47 loc) · 1.09 KB
/
example.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "quick-ftxui.hpp"
#include <iostream>
#include <string>
using namespace std;
using namespace quick_ftxui;
int main() {
int x = 5;
string y = "Init value";
set_int_var("x", &x);
set_str_var("y", &y);
string source_code = R"(Border Vertical{
str z = "init"
str a
int o = 0
Input {
"Type something...",
y
}
RedLight Slider {
"Test: ",
x,
0,
100,
2
}
Magenta Button{
"Chrome",
System("/usr/bin/google-chrome-stable"),
Animated,
z
}
Green Menu{
[ "Physics", "Maths", "Chemistry", "Biology",],
VerticalAnimated,
o
}
Button {
"Exit",
"Exit"
}
})";
parse_qf(source_code);
cout << "Slider value is: " << x << "\n";
cout << "User input is: " << y << "\n";
cout << "Option no. selected in Menu is: " << get_int("o") + 1 << "\n";
cout << "Chrome debug msgs are: " << get_str("z") << "\n";
}