File tree Expand file tree Collapse file tree 4 files changed +40
-5
lines changed Expand file tree Collapse file tree 4 files changed +40
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ include(FetchContent)
6
6
set (FETCHCONTENT_UPDATES_DISCONNECTED TRUE )
7
7
FetchContent_Declare (ftxui
8
8
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
9
- GIT_TAG v2 .0.0
9
+ GIT_TAG v3 .0.0
10
10
)
11
11
12
12
FetchContent_GetProperties (ftxui )
@@ -31,4 +31,12 @@ target_link_libraries(ftxui-starter
31
31
PRIVATE ftxui::component # Not needed for this example.
32
32
)
33
33
34
- install (TARGETS ftxui-starter RUNTIME DESTINATION "bin" )
34
+ if (EMSCRIPTEN )
35
+ string (APPEND CMAKE_CXX_FLAGS " -s USE_PTHREADS" )
36
+ string (APPEND CMAKE_EXE_LINKER_FLAGS " -s ASYNCIFY" )
37
+ string (APPEND CMAKE_EXE_LINKER_FLAGS " -s PROXY_TO_PTHREAD" )
38
+
39
+ foreach (file "index.html" "run_webassembly.py" )
40
+ configure_file ("src/${file} " ${file} )
41
+ endforeach (file )
42
+ endif ()
Original file line number Diff line number Diff line change @@ -13,8 +13,18 @@ Minimal starter project using the [FTXUI library](https://github.com/ArthurSonzo
13
13
mkdir build
14
14
cd build
15
15
cmake ..
16
- make -j3
17
- ./ftxuistarter
16
+ make -j
17
+ cd ../target
18
+ ./ftxui-starter
19
+ ~~~
20
+
21
+ ## Webassembly build:
22
+ ~~~ bash
23
+ mkdir build_emscripten && cd build_emscripten
24
+ emcmake cmake ..
25
+ make -j
26
+ ./run_webassembly.py
27
+ (visit localhost:8000)
18
28
~~~
19
29
20
30
## Linux snap build:
Original file line number Diff line number Diff line change @@ -76,6 +76,23 @@ <h1>ftxui-starter example </h1>
76
76
text-decoration : underline;
77
77
}
78
78
79
+ select {
80
+ display : block;
81
+ padding : .6em 1.4em .5em .8em ;
82
+ border-radius : 20px 20px 0px 0px ;
83
+ font-size : 16px ;
84
+ font-family : sans-serif;
85
+ font-weight : 700 ;
86
+
87
+ color : # 444 ;
88
+ line-height : 1.3 ;
89
+ background-color : black;
90
+ border : 0px ;
91
+ color : white;
92
+ transition : color 0.2s linear;
93
+ transition : background-color 0.2s linear;
94
+ }
95
+
79
96
# terminal {
80
97
padding : 10px ;
81
98
border : none;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ int main(void) {
33
33
auto screen = Screen::Create (Dimension::Full (), Dimension::Fit (document));
34
34
Render (screen, document);
35
35
36
- std::cout << screen.ToString () << std::endl;
36
+ std::cout << screen.ToString () << ' \0 ' << std::endl;
37
37
38
38
return EXIT_SUCCESS;
39
39
}
You can’t perform that action at this time.
0 commit comments